Closed MisLink closed 2 years ago
no plan. i think log.DefaultLogger.SetLevel(l) is enough for most users.
let us keep eyes on this issue, if needed, let me add a .SetLevelRef(p *uint32) to this lib.
Here is my use case: We have a client program which its logger level can be changed by remote for debugging. It contains many modules (we call them plugins) own the copy of logger with the Context
marked the plugin.
Got it, let expose a global method, log.SetLevelForAllLoggers(l)
, it use atomic change a hidden global unit32 inside this lib, then all logger slient()
method will respect it.
Make sense?
Sounds great. Actually, I implement it in the same way: #53
thanks! Will look today.
In consideration of performance, let me close this request for now, until we could find a better way. thanks again!
Setting level to a specific logger is not very useful, normally we want to change level for all created logger. There is no way to do it currently.