Last active
January 25, 2022 18:39
-
-
Save umutbasal/e3bd585874a5246778d5cebb2b56da10 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
let override = (name, func, callback) => { | |
return (...args) => { | |
let ret = func(...args); | |
callback(name, func, args, ret) | |
return ret; | |
}; | |
}; | |
console.error = override("console.error", console.error, (name, func, args, ret)=>{ | |
console.log({name, func, args, ret}) | |
}) | |
console.error("something broke") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment