zap
zap copied to clipboard
Added OnLevel method to allow for configurable log level
I do this in a custom middleware I have in my project but I thought why not use your published version. I do need to be able to switch levels however so did this.
What do you think?
Ping @appleboy would this be of interest?
how to change log level?
Zap has an atomic level zapcore.AtomicLevel that can be changed runtime safely.
If you give the constructor in this patch a given level say DebugLevel it will only log on that level and combined with the AtomicLogger you can switch on and off that behaviour.
As for how you signal the app is up to the application creator. I often use a Nats channel or a Zeromq to broadcast changes like these but you could do whatever suits you I guess.
If you want to I can provide an example in the example directory as well.
I hope the example isn't too messy @appleboy does this work?
I really don't know why the check failed.
I have no idea what the check that fails mean:
The command "embedmd -d *.md" exited with 2.
@dahankzter because you change the example code, please also update the readme.
see more detail about embedmd tool github.com/campoy/embedmd
conflicts.
fixed in #53