refactor: migrate console usage to shared loggers

This commit is contained in:
thePR0M3TH3AN committed 2025-10-15 14:37:25 -04:00
1 parent 52af2082d5
commit 7ae07b1369
54 files changed
+940 -1197

No files matched your search

+5 -4
View File
@@ -1,3 +1,4 @@
import { userLogger } from "./utils/logger.js";
const STORAGE_KEY = "bitvid:theme";
const FALLBACK_THEME = "dark";
const VALID_THEMES = new Set(["light", "dark"]);
@@ -42,7 +43,7 @@ const readStoredTheme = () => {
const stored = window.localStorage.getItem(STORAGE_KEY);
return normalizeTheme(stored);
} catch (error) {
console.warn("Unable to read stored theme preference:", error);
userLogger.warn("Unable to read stored theme preference:", error);
return null;
}
};
@@ -54,7 +55,7 @@ const persistTheme = (theme) => {
try {
window.localStorage.setItem(STORAGE_KEY, theme);
} catch (error) {
console.warn("Unable to persist theme preference:", error);
userLogger.warn("Unable to persist theme preference:", error);
}
};
@@ -92,7 +93,7 @@ const updateThemeColorMeta = (theme) => {
.trim();
}
} catch (error) {
console.warn("Unable to compute theme color token:", error);
userLogger.warn("Unable to compute theme color token:", error);
}
const fallback = FALLBACK_META_COLORS[theme] || FALLBACK_META_COLORS[FALLBACK_THEME];
@@ -179,7 +180,7 @@ const collectToggleElements = (root = document) => {
}
});
} catch (error) {
console.warn(`Invalid selector for theme toggle: ${selector}`, error);
userLogger.warn(`Invalid selector for theme toggle: ${selector}`, error);
}
});