0

I want to override my console.log function globally. I have multiple JS file where I want to use the changed console.log.

New console.log will use the stdout so i can see on the console and also it will log into a file.

mszabolcs
  • 67
  • 1
  • 10
  • 1
    See if this is what you need. https://stackoverflow.com/questions/7042611/override-console-log-for-production – martinho Aug 01 '18 at 10:09
  • I did a search before I made this...thats cool. I want to override the console.log. Thats okay. But is there any solution for do it globally? Like `console` is global. You dont have to define before use it. I want almost the same. I want to override completely the console.log so I can use my own logging everywhere. – mszabolcs Aug 01 '18 at 10:12
  • why not create a snippet in your IDE with the log you need? – martinho Aug 01 '18 at 10:43
  • I have a lot `console.log()` in my code already in every file. That would be easier to just change the function. – mszabolcs Aug 01 '18 at 10:46

0 Answers0