1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00

add console-error to the Logger class

This commit is contained in:
pmario 2022-12-15 16:48:43 +01:00
parent 0b1a4f3a4d
commit 38864e6765

View File

@ -52,7 +52,19 @@ Logger.prototype.log = function(/* args */) {
logMessage[logMessage.length-1] += $tw.utils.terminalColour();
return Function.apply.call(console.log, console, logMessage);
}
}
}
};
/*
Log an error message to console.error so it also gets a red colour in browsers
*/
Logger.prototype.error = function(/* args */) {
var self = this;
if(console !== undefined && console.error !== undefined) {
var logMessage = [$tw.utils.terminalColour(this.colour) + this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0));
logMessage[logMessage.length-1] += $tw.utils.terminalColour();
return Function.apply.call(console.error, console, logMessage);
}
};
/*