feat: centralize debug logging with environment control

- Replace stray console.log statements with logger.debug() for controlled output
- Add VITE_DEBUG_LOGGING environment variable control for all debug messages
- Convert databaseUtil, PlatformServiceFactory, and WebPlatformService to use centralized logger
- Wrap Electron console.log statements with environment variable checks
- Update SQLWorker to use controlled debug messaging instead of direct console.log
- Ensure debug logging is disabled by default for production safety

All debug logging now controlled by VITE_DEBUG_LOGGING=true environment variable.
This commit is contained in:
Matthew Raymer
2025-07-30 10:58:11 +00:00
parent ca828d45a6
commit 6a622d20b8
15 changed files with 223 additions and 47 deletions

View File

@@ -86,6 +86,7 @@
import { Component, Vue } from "vue-facing-decorator";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
import { logger } from "@/utils/logger";
@Component({
mixins: [PlatformServiceMixin],
@@ -267,7 +268,7 @@ This tests the complete save → retrieve cycle with actual database interaction
this.result = `User #0 settings test completed. isRegistered: ${accountSettings.isRegistered}`;
} catch (error) {
this.result = `Error testing User #0 settings: ${error}`;
console.error("Error testing User #0 settings:", error);
logger.error("Error testing User #0 settings:", error);
}
}
}