Here is my logger.js
:
const _nativeLog = console.log;
console.log = function (...args) {
// doing something else in log method
_nativeLog.apply(this, args)
}
After this code, all logs in console sims to be triggered by my logger.js
file. And it's normal because I fire the _nativeLog
method inside logger.js
.
Here is the output:
My question is that is it possible to keep the original filename that calls the overridden console.log
method and show it as origin in the console.