mirror of
https://github.com/apple/swift-log
synced 2026-11-25 03:57:48 +00:00
Proposal discussion thread: https://forums.swift.org/t/proposal-slg-0004-metadata-value-attributes-revision-2/86488 Add an extensible per-value attribute mechanism for metadata. ### Motivation: Metadata values in `swift-log` are opaque strings by the time the `LogHandler` receives them. The call site often knows things about a value that the handler cannot infer — for example, whether the value should be redacted in different environments. ### Modifications: - SLG-0004 proposal is updated based on the feedback. - Added `AttributedStringCarrier: CustomStringConvertible`-based mechanism to `Logging`. - Added benchmarks and benchmark thresholds for the new attributed metadata. ### Result: `swift-log` provides an optional extensible mechanism for attaching attributes to metadata values. --------- Co-authored-by: Franz Busch <privat@franz-busch.de>
27 lines
475 B
Markdown
27 lines
475 B
Markdown
# ``Logging/SwiftLogNoOpLogHandler``
|
|
|
|
A log handler that silently discards all log messages.
|
|
|
|
## Topics
|
|
|
|
### Creating a Swift Log no-op log handler
|
|
|
|
- ``init()``
|
|
- ``init(_:)``
|
|
|
|
### Sending log messages
|
|
|
|
- ``log(event:)``
|
|
- ``log(level:message:metadata:source:file:function:line:)``
|
|
- ``log(level:message:metadata:file:function:line:)``
|
|
|
|
### Updating metadata
|
|
|
|
- ``subscript(metadataKey:)``
|
|
|
|
### Inspecting a log handler
|
|
|
|
- ``logLevel``
|
|
- ``metadata``
|
|
- ``metadataProvider``
|