Files
swift-log/Sources/Examples/MUXExample.swift
T
tomer doron 132af4ff5a add multiplex logger
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
2019-01-02 14:58:37 -08:00

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!")
}
}