mirror of
https://github.com/apple/swift-log
synced 2026-11-23 03:44:22 +00:00
Fixes #519. ## Motivation When both `logLevel` and `handler` are provided, `withLogger` sets the level on the current handler before replacing it. Since `Logger.logLevel` forwards to the handler, the replacement discards the requested level and uses its own instead. ## Modifications - Install the replacement handler before applying the explicit log level in both sync and async overloads. - Add regression tests for `.debug` and `.warning` in both overloads, covering filtering and scope isolation. ## Result The scoped logger filters messages at the requested level. Regression tests fail before the fix and pass afterward. All 172 tests pass on macOS with Swift 6.4. Formatting and `git diff --check` also pass.