(input: unknown)
| 42 | } |
| 43 | |
| 44 | function format(input: unknown) { |
| 45 | const value = typeof input === "string" ? input : Formatter.format(input) |
| 46 | return /^[^\s="\\]+$/.test(value) ? value : JSON.stringify(value) |
| 47 | } |
| 48 | |
| 49 | export function fileLogger(file = path.join(Global.Path.log, "opencode.log"), id: string = runID) { |
| 50 | // Do not set batchWindow to 0; it causes high idle CPU usage. |