TIL You can modify the console object



  • So, by doing:

    console.__log = console.log;
    console.log = function () {
        console.__log('Now logging...');
        console.__log.apply(null, arguments);
    }
    

    Whenever you call console.log('test') it now appends the string to your output. Pretty neat!


Log in to reply