Make -debug a global config flag, clean up logger.Debugf() callsites
This commit is contained in:
@ -5,6 +5,8 @@ import (
|
||||
"log"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"govpp-snmp-example/config"
|
||||
)
|
||||
|
||||
// logf logs a message with automatic caller information (file:function)
|
||||
@ -34,9 +36,9 @@ func Printf(format string, args ...interface{}) {
|
||||
logf(format, args...)
|
||||
}
|
||||
|
||||
// Debugf logs a debug message with caller information if debug is true
|
||||
func Debugf(debug bool, format string, args ...interface{}) {
|
||||
if debug {
|
||||
// Debugf logs a debug message with caller information if global debug is enabled
|
||||
func Debugf(format string, args ...interface{}) {
|
||||
if config.Debug {
|
||||
logf(format, args...)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user