Not sure if this is by design or not. But it's a bit odd.
|
return defaultBackend.IsEnabledFor(level, l.Module) |
In my code I was establishing my own logger with its own backend, e.g.
diagLogger, err := logging.GetLogger(diagModuleName)
if err != nil {
return ret, err
}
fileBackend := logging.NewLogBackend(diagnosticsFile, "", stdlog.LstdFlags)
leveledBackend := logging.AddModuleLevel(fileBackend)
leveledBackend.SetLevel(logging.DEBUG, diagModuleName)
diagLogger.SetBackend(leveledBackend)
the effect of that leveledBackend.SetLevel(logging.DEBUG, diagModuleName) doesn't seem to do anything,
cause when we log with diagLogger.Debug then it seems to be querying the "default backend"...
I am solving this by just setting the log level for the given module in the default backend as well... But seemed worth pointing this out. Perhaps it's intended, but seemed a bit iffy.
Not sure if this is by design or not. But it's a bit odd.
go-logging/logger.go
Line 140 in 970db52
In my code I was establishing my own logger with its own backend, e.g.
the effect of that
leveledBackend.SetLevel(logging.DEBUG, diagModuleName)doesn't seem to do anything,cause when we log with
diagLogger.Debugthen it seems to be querying the "default backend"...I am solving this by just setting the log level for the given module in the default backend as well... But seemed worth pointing this out. Perhaps it's intended, but seemed a bit iffy.