console: allow multiple arguments in console.log()

This commit is contained in:
bordun 2021-03-01 10:49:09 +01:00
parent f4261812af
commit ba08c2381f
2 changed files with 7 additions and 2 deletions

View file

@ -37,13 +37,17 @@ class UiConsole extends UiSidePanel {
console._log = console.log
console.log = function(message){
_this.log('log', message)
for (let arg of arguments) {
_this.log('log', arg)
}
console._log(...arguments)
}
console._error = console.error
console.error = function(message){
_this.log('error', message)
for (let arg of arguments) {
_this.log('error', arg)
}
console._error(...arguments)
}