mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +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>
20 lines
323 B
Markdown
20 lines
323 B
Markdown
# ``Logging/LogEvent``
|
|
|
|
## Topics
|
|
|
|
### Creating a log event
|
|
|
|
- ``init(level:message:metadata:source:file:function:line:)``
|
|
- ``init(level:message:error:metadata:source:file:function:line:)``
|
|
|
|
### Inspecting a log event
|
|
|
|
- ``level``
|
|
- ``message``
|
|
- ``error``
|
|
- ``metadata``
|
|
- ``source``
|
|
- ``file``
|
|
- ``function``
|
|
- ``line``
|