mirror of
https://github.com/apple/swift-log
synced 2026-11-23 03:44:22 +00:00
Expose `StreamLogHandler` to the public which replaces the previously internal `StdoutLogHandlers`. Users can choose now the output stream, while `stdout` is the default. ### Motivation: As discussed on #51 and #60 ### Modifications: Rename `StdoutLogHandler` to `StreamLogHandler` and provide 2 factory methods `standardOutput(label:)` and `standardError(label:)` for using during bootstrapping. ### Result: Users who adopt other logging backends during `LoggingSystem` bootstrapping will still be able to use the default log handler to get very basic console output to their choice of `stdout` or `stderr`. ### Example: ``` // Log to both stderr and stdout for good measure LoggingSystem.bootstrap { MultiplexLogHandler([ FancyLoggingBackend(label: $0), StreamLogHandler.standardError(label: $0), StreamLogHandler.standardOutput(label: $0) ]) } ```