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
+9 -6
View File
@@ -23,6 +23,9 @@
*/
import { nativeVideoActive } from "$lib/stores/nativeVideo";
import { createLogger } from "$lib/utils/logger";
const log = createLogger("videoSurface");
interface AndroidVideoSurfaceBridge {
setTransparent(transparent: boolean): void;
@@ -50,7 +53,7 @@ export function isNativeSurfaceBridgeAvailable(): boolean {
try {
return bridge()?.isSupported() ?? false;
} catch (err) {
console.warn("[videoSurface] isSupported check failed:", err);
log.warn("isSupported check failed:", err);
return false;
}
}
@@ -73,17 +76,17 @@ export function enableNativeVideoCompositing(): void {
// correctly behind a WebView that never stopped painting its own opaque
// background. That ambiguity is what DR-172 was left holding. MainActivity's
// console bridge forwards this to logcat under the JellyTauWeb tag.
console.error(
"[videoSurface] AndroidVideoSurface bridge is MISSING - the webview will " +
log.error(
"AndroidVideoSurface bridge is MISSING - the webview will " +
"stay opaque and native video will play as audio with no picture"
);
return;
}
try {
androidVideoSurface.setTransparent(true);
console.log("[videoSurface] compositing enabled (setTransparent(true) sent)");
log.debug("compositing enabled (setTransparent(true) sent)");
} catch (err) {
console.warn("[videoSurface] setTransparent(true) failed:", err);
log.warn("setTransparent(true) failed:", err);
nativeVideoActive.set(false);
}
}
@@ -93,7 +96,7 @@ export function disableNativeVideoCompositing(): void {
try {
bridge()?.setTransparent(false);
} catch (err) {
console.warn("[videoSurface] setTransparent(false) failed:", err);
log.warn("setTransparent(false) failed:", err);
}
// Always clear the page layer, even if the bridge call failed, so the app is
// never left rendering over a transparent window.