refactor(logging): route frontend console calls through the logger
TRACES: | DR-204 484 ungated `console.*` calls across 63 non-test frontend files shipped to end users with no way to turn them off. Mechanical substitution, no control flow, error handling or message semantics changed: console.log / console.debug -> log.debug console.info -> log.info console.warn -> log.warn console.error -> log.error Hand-written `"[Scope] …"` prefixes are dropped where the logger's scope now carries them; scope names that already existed are preserved verbatim (`[Auth]`, `[VideoPlayer]`, `[PiP]`, …) and inferred from the filename where a file had none. `src/routes/player/[id]/+page.svelte` keeps its `NextEpisode` and `AutoPlay` sub-scopes as separate loggers rather than flattening them into the page scope. `grep -rn 'console\.' src/` now matches nothing outside the tests and the facade itself.
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
import { playbackPosition } from "$lib/stores/player";
|
||||
import { lmsSync, isLmsSession, macForSession } from "$lib/stores/lmsSync";
|
||||
import type { Session } from "$lib/api/types";
|
||||
import { createLogger } from "$lib/utils/logger";
|
||||
|
||||
const log = createLogger("SessionPicker");
|
||||
|
||||
interface Props {
|
||||
isOpen?: boolean;
|
||||
@@ -41,7 +44,7 @@
|
||||
onClose();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to select session:", error);
|
||||
log.error("Failed to select session:", error);
|
||||
// Error is already stored in playbackMode store
|
||||
}
|
||||
}
|
||||
@@ -67,7 +70,7 @@
|
||||
await lmsSync.fuseZone(masterMac, zoneMac);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to toggle LMS zone:", error);
|
||||
log.error("Failed to toggle LMS zone:", error);
|
||||
// Error is surfaced via the lmsSync store
|
||||
}
|
||||
}
|
||||
@@ -79,7 +82,7 @@
|
||||
onClose();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to transfer to local:", error);
|
||||
log.error("Failed to transfer to local:", error);
|
||||
// Error is already stored in playbackMode store
|
||||
}
|
||||
}
|
||||
@@ -91,7 +94,7 @@
|
||||
onClose();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to disconnect:", error);
|
||||
log.error("Failed to disconnect:", error);
|
||||
// Error is already stored in playbackMode store
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user