mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
Replaced `fputs` with `fwrite`, added test and made spelling corrections Motivation: If a 0 byte is logged, `fputs` would not output the content after the 0 byte making it harder to debug (see #180). `fwrite` uses a count argument so content after 0 byte can be logged. Modifications: Replaced `fputs` with the correct call to `fwrite`. Added helper internal func `contiguousUTF8(_ string: String) -> String.UTF8View`. Added `testStdioOutputStreamWrite()` to test ability to log content after 0 byte. Result: Improved debugging experience Co-authored-by: Johannes Weiss <johannesweiss@apple.com>