mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Added logging with configurable levels to make debugging easier.
This commit is contained in:
parent
124ff83206
commit
d079420d46
17 changed files with 88 additions and 18 deletions
|
@ -91,7 +91,7 @@ App.prototype.loaded = function() {
|
|||
* @param {boolean} [logToConsole=false]
|
||||
*/
|
||||
App.prototype.handleError = function(err, logToConsole) {
|
||||
if (logToConsole) console.error(err);
|
||||
if (logToConsole) log.error(err);
|
||||
const msg = err.displayStr || err.toString();
|
||||
this.alert(msg, "danger", this.options.errorTimeout, !this.options.showErrors);
|
||||
};
|
||||
|
@ -129,6 +129,7 @@ App.prototype.autoBake = function() {
|
|||
if (this.autoBakePause) return false;
|
||||
|
||||
if (this.autoBake_ && !this.baking) {
|
||||
log.debug("Auto-baking");
|
||||
this.bake();
|
||||
} else {
|
||||
this.manager.controls.showStaleIndicator();
|
||||
|
@ -569,7 +570,7 @@ App.prototype.isLocalStorageAvailable = function() {
|
|||
App.prototype.alert = function(str, style, timeout, silent) {
|
||||
const time = new Date();
|
||||
|
||||
console.log("[" + time.toLocaleString() + "] " + str);
|
||||
log.info("[" + time.toLocaleString() + "] " + str);
|
||||
if (silent) return;
|
||||
|
||||
style = style || "danger";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue