forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
45 lines (34 loc) · 851 Bytes
/
log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package log
import (
"os"
golog "github.com/coreos/etcd/third_party/github.com/coreos/go-log/log"
)
// The Verbose flag turns on verbose logging.
var Verbose bool = false
var logger *golog.Logger = golog.New("etcd", false,
golog.CombinedSink(os.Stdout, "[%s] %s %-9s | %s\n", []string{"prefix", "time", "priority", "message"}))
func Infof(format string, v ...interface{}) {
logger.Infof(format, v...)
}
func Debugf(format string, v ...interface{}) {
if Verbose {
logger.Debugf(format, v...)
}
}
func Debug(v ...interface{}) {
if Verbose {
logger.Debug(v...)
}
}
func Warnf(format string, v ...interface{}) {
logger.Warningf(format, v...)
}
func Warn(v ...interface{}) {
logger.Warning(v...)
}
func Fatalf(format string, v ...interface{}) {
logger.Fatalf(format, v...)
}
func Fatal(v ...interface{}) {
logger.Fatalln(v...)
}