Skip to content

Commit f26fe42

Browse files
committed
[Functionality] don't be so verbose when logging
1 parent 9c2227e commit f26fe42

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

logger.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ var (
2121
format = logging.MustStringFormatter(
2222
"%{color}%{time:15:04:05.000} %{shortfunc} ▶ %{level:.8s}%{color:reset} %{message}",
2323
)
24+
25+
ShouldOutputDebugMessages = true
2426
)
2527

2628
func Debug(message string, args ...interface{}) {
27-
log.Debugf(message, args...)
29+
if ShouldOutputDebugMessages {
30+
log.Debugf(message, args...)
31+
}
2832
}
2933

3034
func Error(message string, args ...interface{}) {
@@ -43,6 +47,10 @@ func Warning(message string, args ...interface{}) {
4347
log.Warningf(message, args...)
4448
}
4549

50+
func SetLogger(backendLogger logging.Backend) {
51+
logging.SetBackend(backendLogger)
52+
}
53+
4654
func init() {
4755
backend := logging.NewLogBackend(os.Stderr, "", 0)
4856
formatter := logging.NewBackendFormatter(backend, format)

0 commit comments

Comments
 (0)