mag icon indicating copy to clipboard operation
mag copied to clipboard

callsite info

Open dylang opened this issue 10 years ago • 3 comments

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.

dylang avatar Jul 24 '14 22:07 dylang

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.

mahnunchik avatar Jul 25 '14 15:07 mahnunchik

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.

dylang avatar Jul 25 '14 16:07 dylang

You have to kick the developer who uses uninformative messages;)

I'll think about how I can add this feature as separate module.

mahnunchik avatar Sep 06 '14 17:09 mahnunchik