Files
ShabloneandElias 5c0a725b82 fix(monitor): continue log writes when stdout is unavailable on detached Windows consoles (fixes #10882) (#10889)
### Purpose

#10726 introduces a problematic side effect which only surfaced recently
in #10882:
On Windows 24H2 stdout will be invalid when Syncthing is started
detached from a console. This caused the monitors logwriter to fail
silently before it writes it a log file.
This PR fixes this by letting the multiwriter continue even after
failing on stdout.

### Testing

#10882 can be reproduced without this PRs commit. With this PR logging
does work again.
Following scenarios are tested in which the logfile will be written
again
-console: syncthing.exe
-console: start "" syncthing.exe
-console: start "" syncthing.exe serve --log-file=path
-explorer: double click


`go test ./lib/osutil ` checks if the introduced tolerantMultiWriter
writes to all targets even on errors.

---------

Signed-off-by: Elias <1elias.bauer@gmail.com>
Co-authored-by: Elias <1elias.bauer@gmail.com>
2026-09-22 14:47:41 +02:00
..
…
…
…
…
2025-10-23 22:48:54 +02:00