-1

enter image description here

I got log entries like this, probably the result of a console.log somewhere. How do I figure out which source file it's from?

Harry
  • 52,711
  • 71
  • 177
  • 261
  • 2
    I don't think it's possible to say from the log alone. You either need to look for all code that logs stuff or do some modification (likely - overwrite the logging function with slightly custom logic) and then look at the new log later on. – VLAZ Jan 04 '20 at 21:29
  • @VLAZ was hoping that there was a npm module that does that custom logging already? – Harry Jan 04 '20 at 22:02
  • 1
    There probably is but I think you'd also need to change all `console.log`s to `whatevermodule.log` calls. I am not sure there is a module that just overrides the default logging, although there might be. [I've written before about overwriting logging](https://stackoverflow.com/questions/39634926/how-to-disable-console-log-messages-based-on-criteria-from-specific-javascript-s/) and I think parts of this might be of use to you. I'll try to do some research for Node specifically and post an answer here, if I find anything useful. – VLAZ Jan 04 '20 at 22:04
  • @VLAZ found the answer here. Thanks for your help. https://stackoverflow.com/questions/45395369/how-to-get-console-log-line-numbers-shown-in-nodejs – Harry Jan 05 '20 at 01:46
  • 1
    @VLAZ ahh this is what I wanted: https://www.npmjs.com/package/debug-trace – Harry Jan 05 '20 at 01:57

1 Answers1

0

ahh this is what I wanted: npmjs.com/package/debug-trace

Harry
  • 52,711
  • 71
  • 177
  • 261