We are happy to answer your questions about the code or discuss technical ideas.
Please complete the following checklist (by adding [x]):
My proton-drive.log log file is all weird and messed up. This is because the log writer starts at byte 0 and overwrites as it goes, without truncating the file or rotating it.
|
constructor(logDir: string) { |
|
this.formatter = new BasicLogFormatter(); |
|
|
|
const logFile = path.join(logDir, 'proton-drive.log'); |
|
const file = Bun.file(logFile); |
|
this.writer = file.writer(); |
|
} |
Consequences:
- The log file contains incomplete logs from many different runs, especially if the client has been used many times and with some old long runs
- The file stays at the size of the largest run ever. My log file is currently permanently 89MB, most of it from a weeks-old run, but anyway it's unusable to get info about that run because the majority of it has been overwritten by newer runs
Truncating on open would at least keep the file recent, coherent and small. Even better, append with some size-based cap would additionally let a failed run's log (fully) survive the next invocation and make root-causing past problems that much easier
Please complete the following checklist (by adding [x]):
My
proton-drive.loglog file is all weird and messed up. This is because the log writer starts at byte 0 and overwrites as it goes, without truncating the file or rotating it.sdk/cli/src/telemetry/fileHandler.ts
Lines 16 to 22 in f249616
Consequences:
Truncating on open would at least keep the file recent, coherent and small. Even better, append with some size-based cap would additionally let a failed run's log (fully) survive the next invocation and make root-causing past problems that much easier