fix: archi
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import GUI from "lil-gui";
|
||||
import type { CameraMode, SceneMode } from "@/types/debug";
|
||||
import { isDebugEnabled } from "@/utils/debug/isDebugEnabled";
|
||||
|
||||
export class Debug {
|
||||
private static instance: Debug | null = null;
|
||||
@@ -28,7 +29,7 @@ export class Debug {
|
||||
}
|
||||
|
||||
private constructor() {
|
||||
this.active = new URLSearchParams(window.location.search).has("debug");
|
||||
this.active = isDebugEnabled();
|
||||
this.gui = this.active ? new GUI({ title: "La-Fabrik Debug" }) : null;
|
||||
|
||||
if (this.gui) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export function isDebugEnabled(): boolean {
|
||||
if (typeof window === "undefined") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return new URLSearchParams(window.location.search).has("debug");
|
||||
}
|
||||
+2
-3
@@ -4,6 +4,7 @@ import type {
|
||||
LogLevel,
|
||||
LoggerConfig,
|
||||
} from "@/types/logger";
|
||||
import { isDebugEnabled } from "@/utils/debug/isDebugEnabled";
|
||||
|
||||
const LEVEL_PRIORITY: Record<LogLevel, number> = {
|
||||
debug: 10,
|
||||
@@ -102,9 +103,7 @@ function resolveMinLevel(): LogLevel {
|
||||
return "info";
|
||||
}
|
||||
|
||||
const debugEnabled = new URLSearchParams(window.location.search).has("debug");
|
||||
|
||||
return debugEnabled ? "debug" : "info";
|
||||
return isDebugEnabled() ? "debug" : "info";
|
||||
}
|
||||
|
||||
export const logger = new Logger({
|
||||
|
||||
Reference in New Issue
Block a user