reduce calls to Debugf when not debugging to reduce slice allocs

ref #129
This commit is contained in:
Lucas Clemente
2016-06-04 15:13:46 +02:00
parent 0f941214b4
commit 6a46465092
5 changed files with 84 additions and 17 deletions

View File

@@ -27,6 +27,11 @@ var logLevel = LogLevelNothing
var mutex sync.Mutex
// SetLogWriter sets the log writer.
func SetLogWriter(w io.Writer) {
out = w
}
// SetLogLevel sets the log level
func SetLogLevel(level LogLevel) {
logLevel = level