()
| 96 | } |
| 97 | |
| 98 | export function clearLogFile(): void { |
| 99 | const projectRoot = getProjectRoot() |
| 100 | const defaultLog = path.join(projectRoot, 'debug', 'cli.jsonl') |
| 101 | const targets = new Set<string>() |
| 102 | |
| 103 | if (logPath) { |
| 104 | targets.add(logPath) |
| 105 | } |
| 106 | targets.add(defaultLog) |
| 107 | |
| 108 | for (const target of targets) { |
| 109 | try { |
| 110 | if (existsSync(target)) { |
| 111 | unlinkSync(target) |
| 112 | } |
| 113 | } catch { |
| 114 | // Ignore errors when clearing logs |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | logPath = undefined |
| 119 | pinoLogger = undefined |
| 120 | } |
| 121 | |
| 122 | function sendAnalyticsAndLog( |
| 123 | level: LogLevel, |
no test coverage detected