Skip to content

Commit

Permalink
Merge pull request #18 from ajmeese7/feat/logging-uri-param
Browse files Browse the repository at this point in the history
Control logging levels via URI param
  • Loading branch information
bee-san authored Dec 21, 2023
2 parents 9bba7e2 + ac4c00c commit 49fde14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/web/App.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,16 @@ class App {
this.manager.options.changeTheme(Utils.escapeHtml(this.uriParams.theme));
}

// Read in logging level from URI params
if (this.uriParams.logging) {
const validOptions = ["Silent", "Error", "Warn", "Info", "Debug", "Trace"];
if (validOptions.indexOf(this.uriParams.logging) > -1) {
this.manager.options.logLevelChange(this.uriParams.logging);
} else {
log.warn(`Invalid logging level: ${this.uriParams.logging}`);
}
}

this.autoBakePause = false;
window.dispatchEvent(this.manager.statechange);
}
Expand Down

0 comments on commit 49fde14

Please sign in to comment.