mirror of
https://github.com/Andre-Bzk/twitch4steamdeck.git
synced 2026-11-15 09:33:09 +01:00
feat: unify logging via electron-log and add IPC error boundary
Bug reports from Steam Deck (Flatpak) arrived without any useful context: no terminal, no log file, no trace of what failed. Silent catches in helixClient hid quota and token errors entirely. IPC handler exceptions reached the renderer as rejected promises with no server-side record. electron-log now writes to a rotating log file (~1 MB, 5 files) that users can attach to bug reports. All IPC handlers are wrapped in safeHandle, which logs and re-throws at the boundary. Optional-feature failures (chapters, profile images, viewer counts) emit log.warn with enough context to diagnose. A React ErrorBoundary catches render crashes app-wide and logs them before showing a reload prompt.
This commit is contained in:
+6
-3
@@ -6,6 +6,11 @@ import { PlaybackService } from './playback/playbackService'
|
||||
import { registerIpcHandlers } from './ipc/handlers'
|
||||
import { startGamepadReader } from './input/gamepadReader'
|
||||
import { getHlsCacheEnabled } from './prefs/hlsCachePref'
|
||||
import log from 'electron-log/main'
|
||||
|
||||
log.initialize()
|
||||
log.transports.file.level = 'info'
|
||||
log.transports.console.level = 'debug'
|
||||
|
||||
const isDev = !app.isPackaged
|
||||
|
||||
@@ -130,9 +135,7 @@ app.whenReady().then(async () => {
|
||||
})
|
||||
|
||||
if (!clientId) {
|
||||
console.warn(
|
||||
'[twitch4steamdeck] MAIN_VITE_TWITCH_CLIENT_ID nicht gesetzt — Login wird im UI als nicht konfiguriert angezeigt.'
|
||||
)
|
||||
log.warn('[twitch4steamdeck] MAIN_VITE_TWITCH_CLIENT_ID nicht gesetzt — Login wird im UI als nicht konfiguriert angezeigt.')
|
||||
}
|
||||
|
||||
createWindow()
|
||||
|
||||
Reference in New Issue
Block a user