From bf022dbae8583482d86deec63f0f413e01f8d593 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 2 Apr 2024 12:22:09 +0200 Subject: no async script load and optional logger --- client-web/source/logger.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client-web/source/logger.ts') diff --git a/client-web/source/logger.ts b/client-web/source/logger.ts index 210644a..0141281 100644 --- a/client-web/source/logger.ts +++ b/client-web/source/logger.ts @@ -6,6 +6,7 @@ /// import { e } from "./helper.ts"; +import { PREFS } from "./preferences/mod.ts"; export const LOGGER_CONTAINER = e("div", { class: "logger-container", role: "log", aria_live: "off" }) @@ -35,7 +36,7 @@ export function log(k: LogScope | LogDesc, message: string, ...data: unknown[]) (d.error ? console.error : d.warn ? console.warn : console.log)(`%c[${d.scope}] ${message}`, `color:${log_scope_color[d.scope]}`, ...data); - if (LOGGER_CONTAINER) { + if (LOGGER_CONTAINER && (PREFS.show_log || d.error || d.warn)) { const e = document.createElement("p") e.classList.add("logger-line") if (d.error) e.classList.add("logger-error") -- cgit v1.2.3-70-g09d2