header create

This commit is contained in:
Alex Holliday committed 2026-01-24 16:19:43 +00:00
1 parent d877ecf061
commit b852293447
4 files changed
+47 -12

No files matched your search

+16 -5
View File
@@ -1,14 +1,25 @@
import store from "../store";
const LOG_LEVEL = import.meta.env.VITE_APP_LOG_LEVEL || "debug";
const NO_OP = () => {};
class Logger {
constructor() {
let logLevel = LOG_LEVEL;
this.unsubscribe = store.subscribe(() => {
logLevel = "debug";
this.updateLogLevel(logLevel);
});
this.updateLogLevel(logLevel);
// Defer store subscription to avoid circular dependency during HMR
setTimeout(() => {
try {
import("../store").then(({ default: store }) => {
if (store) {
this.unsubscribe = store.subscribe(() => {
logLevel = "debug";
this.updateLogLevel(logLevel);
});
}
});
} catch (e) {
// Store not ready yet, ignore
}
}, 0);
}
updateLogLevel(logLevel) {