mirror of
https://github.com/apple/swift-log
synced 2026-11-28 04:14:20 +00:00
motivation: add tests to confirm desired functionality changes: * add property for logger metadata (aka context) * improve pretty-metadata (aka pretty-context) generation * add unit tests covering local and global use cases * add [test only] implementation of MDC * format with swiftformat open issues: * should we name the new property metadata or context * should we include a default MDC implmentation as part of the logging API. if we dont, we will encourage libraries binding to specific logging implementations that support it (that was bad in java) * tests are a bit brittle * why is ExampleLoggerImplementation a reference type?
19 lines
385 B
Swift
19 lines
385 B
Swift
import ExampleLoggerImpl
|
|
import Foundation
|
|
import ServerLoggerAPI
|
|
|
|
print("##### explicit logger passing #####")
|
|
ExplicitContextPassingExample.main()
|
|
|
|
print()
|
|
print("##### one global logger #####")
|
|
OneGlobalLoggerExample.main()
|
|
|
|
print()
|
|
print("##### logger per sub-system #####")
|
|
LoggerPerSubsystemExample.main()
|
|
|
|
print()
|
|
print("##### other random examples #####")
|
|
RandomExample.main()
|