-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement scoped loggers from
ModuleLogger
s 🍰
On certain occasions, one needs to pass in a simple `Logger` instance but want log events forwarded to a larger logging infrastructure. If we're dealing with a `ModuleLogger` with multiple registered modules, one may want to derive a simpler `Logger` that sends all events under a single module to the upstream logger. To achieve that, `ModuleLogger` can now create scoped loggers via a new `scopedLogger(for:)` helper. ## Changes - Create `ModuleLogger.scopedLogger(for:)` helper. - Create new `Log.ForwardingLogger` private helper class to forward log events to an upstream (Module) logger.
- Loading branch information
Showing
2 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters