1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Move logging to internal package.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 13:54:44 +03:00
parent 4fba0dda91
commit 8679174a1b
9 changed files with 59 additions and 34 deletions

22
internal/log.go Normal file
View File

@ -0,0 +1,22 @@
package internal
import (
"fmt"
"io/ioutil"
"log"
)
var Debug bool
var Logger = log.New(ioutil.Discard, "redis: ", log.LstdFlags)
func Debugf(s string, args ...interface{}) {
if !Debug {
return
}
Logger.Output(2, fmt.Sprintf(s, args...))
}
func Logf(s string, args ...interface{}) {
Logger.Output(2, fmt.Sprintf(s, args...))
}