mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47: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>
23 lines
502 B
Markdown
23 lines
502 B
Markdown
# ``Logging/LogHandler``
|
|
|
|
## Topics
|
|
|
|
### Sending log messages
|
|
|
|
- ``log(event:)-7x67``
|
|
- ``log(event:)-17f2r``
|
|
- ``log(level:message:metadata:source:file:function:line:)-8kgt7``
|
|
- ``log(level:message:metadata:source:file:function:line:)-69pez``
|
|
- ``log(level:message:metadata:file:function:line:)-89rya``
|
|
- ``log(level:message:metadata:file:function:line:)-1xdau``
|
|
|
|
### Updating metadata
|
|
|
|
- ``subscript(metadataKey:)``
|
|
|
|
### Inspecting a log handler
|
|
|
|
- ``logLevel``
|
|
- ``metadata``
|
|
- ``metadataProvider``
|