File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ var (
21
21
format = logging .MustStringFormatter (
22
22
"%{color}%{time:15:04:05.000} %{shortfunc} ▶ %{level:.8s}%{color:reset} %{message}" ,
23
23
)
24
+
25
+ ShouldOutputDebugMessages = true
24
26
)
25
27
26
28
func Debug (message string , args ... interface {}) {
27
- log .Debugf (message , args ... )
29
+ if ShouldOutputDebugMessages {
30
+ log .Debugf (message , args ... )
31
+ }
28
32
}
29
33
30
34
func Error (message string , args ... interface {}) {
@@ -43,6 +47,10 @@ func Warning(message string, args ...interface{}) {
43
47
log .Warningf (message , args ... )
44
48
}
45
49
50
+ func SetLogger (backendLogger logging.Backend ) {
51
+ logging .SetBackend (backendLogger )
52
+ }
53
+
46
54
func init () {
47
55
backend := logging .NewLogBackend (os .Stderr , "" , 0 )
48
56
formatter := logging .NewBackendFormatter (backend , format )
You can’t perform that action at this time.
0 commit comments