From 63e3b97bcafdc1601bfc068c00a7fb0d53b8360c Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Thu, 26 Jun 2025 21:17:59 -0700 Subject: [PATCH] log -> error, remove unnecesary logs --- src/main/features/core/player/index.ts | 2 +- src/main/features/linux/mpris.ts | 2 +- src/main/index.ts | 2 +- src/renderer/api/utils.ts | 2 +- .../components/virtual-table/hooks/use-virtual-table.ts | 2 +- .../action-required/components/route-error-boundary.tsx | 2 +- src/renderer/features/lyrics/queries/lyric-query.ts | 2 +- .../playlists/components/playlist-detail-song-list-content.tsx | 2 +- src/renderer/hooks/use-fast-average-color.tsx | 2 +- src/renderer/router/app-outlet.tsx | 3 --- 10 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/features/core/player/index.ts b/src/main/features/core/player/index.ts index dc8dc513..bc02409e 100644 --- a/src/main/features/core/player/index.ts +++ b/src/main/features/core/player/index.ts @@ -105,7 +105,7 @@ const createMpv = async (data: { try { await mpv.start(); } catch (error: any) { - console.log('mpv failed to start', error); + console.error('mpv failed to start', error); } finally { await mpv.setMultipleProperties(properties || {}); } diff --git a/src/main/features/linux/mpris.ts b/src/main/features/linux/mpris.ts index dd57a389..035db8e7 100644 --- a/src/main/features/linux/mpris.ts +++ b/src/main/features/linux/mpris.ts @@ -177,7 +177,7 @@ ipcMain.on('update-song', (_event, song: QueueSong | undefined) => { 'xesam:userRating': song.userRating ? song.userRating / 5 : null, }; } catch (err) { - console.log(err); + console.error(err); } }); diff --git a/src/main/index.ts b/src/main/index.ts index 331ce151..66075554 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -49,7 +49,7 @@ export default class AppUpdater { protocol.registerSchemesAsPrivileged([{ privileges: { bypassCSP: true }, scheme: 'feishin' }]); process.on('uncaughtException', (error: any) => { - console.log('Error in main process', error); + console.error('Error in main process', error); }); if (store.get('ignore_ssl')) { diff --git a/src/renderer/api/utils.ts b/src/renderer/api/utils.ts index 8a445b95..0185926e 100644 --- a/src/renderer/api/utils.ts +++ b/src/renderer/api/utils.ts @@ -10,7 +10,7 @@ export const authenticationFailure = (currentServer: null | ServerListItem) => { if (currentServer) { const serverId = currentServer.id; const token = currentServer.ndCredential; - console.log(`token is expired: ${token}`); + console.error(`token is expired: ${token}`); useAuthStore.getState().actions.updateServer(serverId, { ndCredential: undefined }); useAuthStore.getState().actions.setCurrentServer(null); } diff --git a/src/renderer/components/virtual-table/hooks/use-virtual-table.ts b/src/renderer/components/virtual-table/hooks/use-virtual-table.ts index 543a5e3f..8a91f746 100644 --- a/src/renderer/components/virtual-table/hooks/use-virtual-table.ts +++ b/src/renderer/components/virtual-table/hooks/use-virtual-table.ts @@ -251,7 +251,7 @@ export const useVirtualTable = >({ properties.table.pagination.itemsPerPage; event.api?.ensureIndexVisible(currentPageStartIndex, 'top'); } catch (err) { - console.log(err); + console.error(err); } if (isSearchParams) { diff --git a/src/renderer/features/action-required/components/route-error-boundary.tsx b/src/renderer/features/action-required/components/route-error-boundary.tsx index d277e6a4..d541dffb 100644 --- a/src/renderer/features/action-required/components/route-error-boundary.tsx +++ b/src/renderer/features/action-required/components/route-error-boundary.tsx @@ -17,7 +17,7 @@ const RouteErrorBoundary = () => { const { t } = useTranslation(); const navigate = useNavigate(); const error = useRouteError() as any; - console.log('error', error); + console.error('error', error); const handleReload = () => { navigate(0); diff --git a/src/renderer/features/lyrics/queries/lyric-query.ts b/src/renderer/features/lyrics/queries/lyric-query.ts index e4e91cd1..918a8361 100644 --- a/src/renderer/features/lyrics/queries/lyric-query.ts +++ b/src/renderer/features/lyrics/queries/lyric-query.ts @@ -117,7 +117,7 @@ export const useSongLyricsBySong = ( apiClientProps: { server, signal }, query: { songId: song.id }, }) - .catch((err) => console.log(err)); + .catch((err) => console.error(err)); if (jfLyrics) { localLyrics = { diff --git a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx index 312de882..c0e9e186 100644 --- a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx +++ b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx @@ -207,7 +207,7 @@ export const PlaylistDetailSongListContent = ({ songs, tableRef }: PlaylistDetai const currentPageStartIndex = pagination.currentPage * pagination.itemsPerPage; event.api?.ensureIndexVisible(currentPageStartIndex, 'top'); } catch (err) { - console.log(err); + console.error(err); } setPagination(playlistId, { diff --git a/src/renderer/hooks/use-fast-average-color.tsx b/src/renderer/hooks/use-fast-average-color.tsx index 78951ce2..12e3c901 100644 --- a/src/renderer/hooks/use-fast-average-color.tsx +++ b/src/renderer/hooks/use-fast-average-color.tsx @@ -49,7 +49,7 @@ export const useFastAverageColor = (args: { return setBackground(color.rgb); }) .catch((e) => { - console.log('Error fetching average color', e); + console.error('Error fetching average color', e); idRef.current = id; return setBackground('rgba(0, 0, 0, 0)'); }); diff --git a/src/renderer/router/app-outlet.tsx b/src/renderer/router/app-outlet.tsx index 68ce3c8b..be1e31a9 100644 --- a/src/renderer/router/app-outlet.tsx +++ b/src/renderer/router/app-outlet.tsx @@ -19,8 +19,6 @@ export const AppOutlet = () => { const setFallback = useSetPlayerFallback(); const authState = useServerAuthenticated(); - console.log(authState); - const isActionsRequired = useMemo(() => { const isServerRequired = !currentServer; @@ -57,7 +55,6 @@ export const AppOutlet = () => { } if (isActionsRequired || authState === AuthState.INVALID) { - console.log('required', isActionsRequired); return (