Closed mfursov closed 8 years ago
This is an interesting idea, but isn't something the core of loglevel is ever going to do. Any logic that needs to run at log time necessitates clobbering all stacktraces. Reliably giving you simple working logic without breaking anything (including traces from your log messages) is one of the core features of the library.
Extensions like this are the perfect case for plugins though. Take a look at https://github.com/pimterry/loglevel#writing-plugins in the docs for a bit more background on why this can't really be built in, and how you can set up your own plugin to build that on top of loglevel anyway.
I'm going to close this since I'm not happy to put it into the core library. Do let me know if you end up writing and releasing a plugin though, and I'll happily add a reference to it in the README.
A simple example could be:
I belive this feature will make loglevel very efficient.