Last active
January 14, 2019 07:32
-
-
Save shanghaikid/afa4d493b07f383ed60d39c8abba4f1e to your computer and use it in GitHub Desktop.
save log fed error
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 {error, log} = console; | |
Object.defineProperties(console, { | |
'saveLog': { | |
value: function() { | |
// put backend request here in the try catch error | |
alert('sent', arguments); | |
} | |
}, | |
'log': { | |
value: function() { | |
log.apply(this, arguments); | |
console.saveLog.apply(this, arguments); | |
} | |
}, | |
'error': { | |
value: function() { | |
error.apply(this, arguments); | |
console.saveLog.apply(this, arguments); | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment