mirror of
https://github.com/apple/swift-log
synced 2026-11-26 04:07:49 +00:00
Update documentation to reflect recent changes ### Motivation: The documentation was not updated in SLG-0003 or SLG-0005. Concretely, the examples given in the documentation used the now deprecated multiparameter methods in `LogHandler`, and the new `LogEvent`-based method were not listed among the others. Likewise, the new logging methods (`Logger.trace` etc.) that take an `Error` as a parameter were not added. Lastly, `LogEvent` had no separate entry. While the default rendered docs for these were acceptable, it decreased the discoverability of the new methods, and the examples using deprecated methods were misleading. ### Modifications: * Update all code examples to use non-deprecated methods. * List all new methods on `Logger` and `LogHandler` along the existing ones. * Add a minimal file for `LogEvent` to give it the same look as all other types. * Update code examples in `.md` files to follow swift format. ### Result: Documentation reflects the current state and best practices of `swift-log`. --------- Co-authored-by: Joseph Heck <j_heck@apple.com> Co-authored-by: Vladimir Kukushkin <kukushechkin@mac.com>
1.9 KiB
1.9 KiB
Logging/Logger
Topics
Creating Loggers
init(label:)init(label:metadataProvider:)init(label:factory:)-9uiy2init(label:factory:)-6iktuMetadataProvider
Sending trace log messages
trace(_:metadata:file:function:line:)trace(_:metadata:source:file:function:line:)trace(_:error:metadata:source:file:function:line:)
Sending debug log messages
debug(_:metadata:file:function:line:)debug(_:metadata:source:file:function:line:)debug(_:error:metadata:source:file:function:line:)
Sending info log messages
info(_:metadata:file:function:line:)info(_:metadata:source:file:function:line:)info(_:error:metadata:source:file:function:line:)
Sending notice log messages
notice(_:metadata:file:function:line:)notice(_:metadata:source:file:function:line:)notice(_:error:metadata:source:file:function:line:)
Sending warning log messages
warning(_:metadata:file:function:line:)warning(_:metadata:source:file:function:line:)warning(_:error:metadata:source:file:function:line:)
Sending error log messages
error(_:metadata:file:function:line:)error(_:metadata:source:file:function:line:)error(_:error:metadata:source:file:function:line:)
Sending critical log messages
critical(_:metadata:file:function:line:)critical(_:metadata:source:file:function:line:)critical(_:error:metadata:source:file:function:line:)
Sending general log messages
log(level:_:metadata:file:function:line:)log(level:_:metadata:source:file:function:line:)log(level:_:error:metadata:source:file:function:line:)LevelMessageMetadata
Adjusting logger metadata
subscript(metadataKey:)MetadataValue
Inspecting a logger
labellogLevelhandlermetadataProvider