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:
2026-08-20 19:29:59 +02:00
parent 4c82a0a025
commit d54d8cc7c4
63 changed files with 686 additions and 490 deletions
+5 -2
View File
@@ -38,6 +38,9 @@
import CastButton from "$lib/components/sessions/CastButton.svelte";
import VolumeControl from "./VolumeControl.svelte";
import CachedImage from "../common/CachedImage.svelte";
import { createLogger } from "$lib/utils/logger";
const log = createLogger("MiniPlayer");
interface Props {
media: MediaItem | null;
@@ -159,7 +162,7 @@
await playerController.seek(newPosition);
haptics.tap();
} catch (err) {
console.error("Failed to seek:", err);
log.error("Failed to seek:", err);
toast.show("Failed to seek", "error");
}
}
@@ -230,7 +233,7 @@
// Vertical swipe
if (Math.abs(diffY) > swipeThreshold && diffY > 0) {
// Swiped up - Open full player
console.log("[MiniPlayer] Swipe-up detected, expanding player");
log.debug("Swipe-up detected, expanding player");
haptics.tap();
onExpand?.();
}