mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
Multiple proposal improvements to the API (#41)
* Move `Logging.make` to a `Logger` initializer. * Remove all factory initializers in example and test code.
This commit is contained in:
1 parent
03174f3260
commit
2474d61a80
19 files changed
+336
-376
No files matched your search
@@ -9,10 +9,9 @@ import Logging
|
||||
enum MultiplexExample {
|
||||
static func main() {
|
||||
// boostrap with two of our sample implementations
|
||||
let logging = MultiplexLogging([SimpleLogging().make, FileLogging().make])
|
||||
Logging.bootstrap(logging.make)
|
||||
Logging.bootstrap({ MultiplexLogHandler([SimpleLogHandler(label: $0), FileLogHandler(label: $0)]) })
|
||||
// run the example
|
||||
let logger = Logging.make("com.example.TestApp")
|
||||
let logger = Logger(label: "com.example.TestApp")
|
||||
logger.info("hello world!")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user