mag
mag copied to clipboard
callsite info
It would be helpful to have automatic information about where the logging call was made.
Some logging tools use https://github.com/visionmedia/callsite to get this.
This feature has big disadvantage: calling captureStackTrace
method is too expensive for each call of logger methods.
If you want I can reproduce the tests, but in my tests logger worked approximately 3 times slower.
But there is a workaround. If you realy need StackTrace info then you can just use for example callsite module and log any necessary information where it needed.
I agree it's slower, maybe even more than 3x. I'll need to test my teams code to see if that kind of hit is noticeable by our developers.
This is for dev tooling like our Grunt/Growl tasks, and it's difficult/impossible to know which package was responsible for emitting a debug message.
You have to kick the developer who uses uninformative messages;)
I'll think about how I can add this feature as separate module.