(prefix: string, message: string, ...args: unknown[])
| 129 | } |
| 130 | |
| 131 | private logToFile(prefix: string, message: string, ...args: unknown[]): void { |
| 132 | const logLine = `${prefix} ${message} ${args.map(arg => |
| 133 | typeof arg === 'string' ? arg : JSON.stringify(arg) |
| 134 | ).join(' ')}\n` |
| 135 | |
| 136 | try { |
| 137 | appendFileSync(this.logFilePath, logLine) |
| 138 | } catch (appendError) { |
| 139 | if (process.env.DEBUG) { |
| 140 | console.error('[DEV MODE ONLY] Failed to append to log file:', appendError) |
| 141 | throw appendError |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | export const logger = new Logger() |
no test coverage detected