mirror of
https://github.com/apple/swift-log
synced 2026-11-23 03:44:22 +00:00
Motivation:
`LogHandler` facotories are given a label as input and return a
`LogHandler`. Since the no-op handler doesn't care about the label
callers must provide a thunk: `{ _ in SwiftLogNoOpLogHandler() }`.
That's fine but slightly more annoying to type than it needs to be.
Modifications:
- Add `SwiftLogNoOpLogHandler.init(_: String)`
Result:
Users can create a logger with the no-op handler with:
```swift
Logger(label: "foo", factory: SwiftLogNoOpLogHandler.init)
```
instead of:
```swift
Logger(label: "foo", factory: { _ in SwiftLogNoOpLogHandler() })
```