Skip to content

Keep file logging from crashing background launches - #216

Merged
JulianKahnert merged 1 commit into
developfrom
feature/215-file-log-crash
Oct 19, 2026
Merged

JulianKahnert merged 1 commit into
developfrom
feature/215-file-log-crash

Conversation

@JulianKahnert

Copy link
Copy Markdown
Owner
  • FileHandlerOutputStream opens the day's log file on the first write and reopens it after an open or write error instead of calling fatalError
  • Only the first failure in a row is logged; entries in between reach OSLog only
  • initLogging shares one stream across all logger labels, so Logger.init does no file I/O
  • "App Logs" reads from logFileDirectory() (Documents/logs/) again; it has read Documents/ since Cluster wedge: observability + provenance + Xcode 27 build fix聽#183
  • FileLogHandlerTests cover a failed open (exit test) and the recovery once the directory is writable

Fixes #215

FileLogHandler opened the day's log file inside Logger.init and called
fatalError when that failed. FlowKit Controller build 518 crashed this way
twice on 2026-10-18 during background launches, before
didFinishLaunchingWithOptions ran.

- FileHandlerOutputStream opens the file on the first write and reopens it
  on the next write after an open or write error; the first failure in a
  row is logged, the entries in between reach OSLog only
- initLogging shares one stream across all logger labels, so creating a
  Logger no longer touches the file system
- logFileDirectory() is public and the App Logs screen reads from it; it
  read Documents/ while the files have been written to Documents/logs/
  since #183

Fixes #215
@JulianKahnert
JulianKahnert merged commit 1902c7e into develop Oct 19, 2026
4 checks passed
@JulianKahnert
JulianKahnert deleted the feature/215-file-log-crash branch October 19, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Controller crashes on background launch when FileLogHandler cannot open the log file

1 participant