Files
swift-log/Sources/ExampleUsage/MultiplexExample.swift
T
David Hart 2474d61a80 Multiple proposal improvements to the API (#41)
* Move `Logging.make` to a `Logger` initializer.
* Remove all factory initializers in example and test code.
2019-02-18 20:27:59 +01:00

18 lines
496 B
Swift

//
// THIS IS NOT PART OF THE PITCH, JUST AN EXAMPLE HOW A LOGGER USAGE LOOKS LIKE
//
import ExampleImplementation
import Foundation
import Logging
enum MultiplexExample {
static func main() {
// boostrap with two of our sample implementations
Logging.bootstrap({ MultiplexLogHandler([SimpleLogHandler(label: $0), FileLogHandler(label: $0)]) })
// run the example
let logger = Logger(label: "com.example.TestApp")
logger.info("hello world!")
}
}