You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Reset restores the internal state of the logging library.funcReset() {
// TODO make a global Init() method to be less magic? or make it such that// if there's no backends at all configured, we could use some tricks to// automatically setup backends based if we have a TTY or not.sequenceNo=0b:=SetBackend(NewLogBackend(os.Stderr, "", log.LstdFlags))
b.SetLevel(DEBUG, "")
SetFormatter(DefaultFormatter)
timeNow=time.Now
}
+1 for making it be less magic, would strongly prefer to explicitly invoke .Init() or .Reset() during initial logger setup/configuration.
This just cost me at 2 hours of time to track down why the custom log levels were not working, and I'd love a more elegant solution than the ugly hack of adding the following fragment around all the logging setup and configuration code:
// Wait until after logging.init() has had a chance to run.gofunc() {
time.Sleep(time.Second)
...
}()```
The text was updated successfully, but these errors were encountered:
init() { Reset() }
at the bottom of logger.go clobbers any previously-set custom logging levels.+1 for making it be less magic, would strongly prefer to explicitly invoke
.Init()
or.Reset()
during initial logger setup/configuration.This just cost me at 2 hours of time to track down why the custom log levels were not working, and I'd love a more elegant solution than the ugly hack of adding the following fragment around all the logging setup and configuration code:
The text was updated successfully, but these errors were encountered: