mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
motivation: support situations when users want to multiplex to multiple logging implementations changes: * add MultiplexLogging (factory) and MUXLogHandler (implementation), allowing user to plug in multiple logging implementations * add tests and examples to demonstrate the functionality
13 lines
406 B
Swift
13 lines
406 B
Swift
import Foundation
|
|
import Logging
|
|
|
|
enum MUXExample {
|
|
static func main() {
|
|
// boostrap with logging that multiplexes to two copies of ExampleLoggerImplementation
|
|
Logging.bootstrap(MultiplexLogging([ExampleLoggerImplementation.init, ExampleLoggerImplementation.init]).make)
|
|
|
|
let logger = Logging.make("com.example.TestApp")
|
|
logger.info("we should see this twice!")
|
|
}
|
|
}
|