mirror of
https://github.com/apple/swift-log
synced 2026-11-25 03:57:48 +00:00
motivation: safer logging system changes: do a precondition check to verify logging syste is only initialized/bootstrapped once per process
26 lines
578 B
Swift
26 lines
578 B
Swift
import Logging
|
|
import ExampleImplementation
|
|
|
|
// boostrap with our sample implementation
|
|
LoggingSystem.bootstrap(SimpleLogHandler.init)
|
|
|
|
print()
|
|
print("##### global logger based system #####")
|
|
GlobalLoggerBasedSystem.main()
|
|
|
|
print()
|
|
print("##### local logger based system #####")
|
|
LocalLoggerBasedSystem.main()
|
|
|
|
print()
|
|
print("##### context based system #####")
|
|
ContextBasedSystem.main()
|
|
|
|
print()
|
|
print("##### multiplexiing to multiple logging implementations #####")
|
|
MultiplexExample.main()
|
|
|
|
print()
|
|
print("##### config based logging implementations #####")
|
|
ConfigExample.main()
|