Merge pull request #18 from ajmeese7/feat/logging-uri-param

Control logging levels via URI param
This commit is contained in:
Autumn 2023-12-21 20:26:18 +00:00 committed by GitHub
commit 49fde14f79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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);
}