Last active
January 22, 2021 09:33
-
-
Save peaBerberian/0933d7e5e5eb0294622891445e2436df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
const cLog = console.log; | |
const cWarn = console.warn; | |
const cError = console.error; | |
const cInfo = console.info; | |
const cDebug = console.debug; | |
function addTSToArgumentList(argList) { | |
const ret = [performance.now()]; | |
for (let i = 0; i < argList.length; i++) { | |
ret.push(argList[i]); | |
} | |
return ret; | |
} | |
console.log = function () { | |
return cLog.apply(console, addTSToArgumentList(arguments)); | |
}; | |
console.warn = function () { | |
return cWarn.apply(console, addTSToArgumentList(arguments)); | |
}; | |
console.error = function () { | |
return cError.apply(console, addTSToArgumentList(arguments)); | |
}; | |
console.info = function () { | |
return cInfo.apply(console, addTSToArgumentList(arguments)); | |
}; | |
console.debug = function () { | |
return cDebug.apply(console, addTSToArgumentList(arguments)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment