Files
ChatLab/apps/desktop/main/logger.ts
T
digua d734389f29 fix(electron): align Windows title bar hover
Use native Window Controls Overlay geometry and sampled background colors so caption hover and drag regions track the system title bar.

Forward original Windows close-handler errors to the shared logger so failures retain their stack traces.
2026-08-07 22:37:04 +08:00

37 lines
868 B
TypeScript

/**
* General app logger (Electron main).
*
* Thin wrapper over the shared node-runtime appLogger so all runtimes write to
* the same rolling `logs/app.log`. Exported shape kept for existing call sites.
*/
import { initAppLogger, appLogger } from '@openchatlab/node-runtime'
import { getLogsDir } from './paths/locations'
let initialized = false
function ensureInit(): void {
if (initialized) return
initialized = true
initAppLogger(getLogsDir())
}
export const logger = {
info: (message: string) => {
ensureInit()
appLogger.info('app', message)
},
warn: (message: string) => {
ensureInit()
appLogger.warn('app', message)
},
error: (message: string, data?: unknown) => {
ensureInit()
appLogger.error('app', message, data)
},
debug: (message: string) => {
ensureInit()
appLogger.debug('app', message)
},
}