Replace console statements with structured logger calls

- Replace 30 console.log/error/warn statements with appropriate logger calls
- Add logger imports where missing (PlatformServiceFactory, PlatformServiceMixin)
- Maintain eslint-disable comments for critical error logging in worker context
- Improve error handling consistency across platform services
- Clean up commented-out logger statements in WebPlatformService

Files affected:
- src/db/databaseUtil.ts: 4 console statements → logger calls
- src/main.electron.ts: 3 console statements → logger calls
- src/registerSQLWorker.js: 9 console statements → logger calls
- src/services/PlatformServiceFactory.ts: 1 console statement → logger call
- src/services/platforms/WebPlatformService.ts: 8 console statements → logger calls
- src/utils/PlatformServiceMixin.ts: 5 console statements → logger calls

Reduces ESLint warnings from 111 to 82 (eliminates all no-console warnings)
This commit is contained in:
Matthew Raymer
2025-07-03 08:32:41 +00:00
parent b377667207
commit 3d7d663f64
6 changed files with 37 additions and 79 deletions

View File

@@ -90,7 +90,7 @@ if (typeof window !== "undefined" && window.require) {
.getRegistrations()
.then(function (registrations) {
for (const registration of registrations) {
console.log(
logger.log(
"[Electron] Unregistering service worker:",
registration.scope,
);
@@ -98,14 +98,11 @@ if (typeof window !== "undefined" && window.require) {
}
})
.catch((error) => {
console.log(
"[Electron] Failed to unregister service workers:",
error,
);
logger.log("[Electron] Failed to unregister service workers:", error);
});
}
} catch (error) {
console.log("[Electron] Service worker cleanup not available:", error);
logger.log("[Electron] Service worker cleanup not available:", error);
}
// Add any Electron-specific initialization here