pimterry / loglevel

:ledger: Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
MIT License
2.62k stars 157 forks source link

Feature/Enhancement: add a level between 'debug' and 'trace' #183

Closed shaunhurley closed 1 year ago

shaunhurley commented 1 year ago

Great library, I'm a big fan, thank you!

Curious to know if this would be of use to anyone else, in which case I may take a stab at a pull request for it, otherwise I'll maybe have a play with a private patch :)

I occasionally want something that falls in between debug and trace - call it 'verbose' or something - mainly because I don't want the stacktrace on many (most) higher detail calls.

Thoughts?

pimterry commented 1 year ago

Great, glad it's working well for you @shaunhurley!

Realistically, it would end up as a breaking change in loglevel to change the current set of levels available, so this is probably not going to happen unless there's a really strong case or a massive demand for it. I'm going to close this for now, but I'm happy to hear from you or others here if that is the case.

For use cases like yours though, where you just want trace without the stacktrace, you may well be able to implement a quick plugin that remaps trace elsewhere to a stacktrace-free console method, or implements other quick workarounds here. YMMV but that will likely be a bit more convenient that forking & modifying the entire library.