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
@@ -7,7 +7,7 @@ import Foundation
|
||||
import Logging
|
||||
|
||||
// since this example mutates the global logger, we need to lock around it
|
||||
var _logger = Logging.make("GlobalLogger")
|
||||
var _logger = Logger(label: "GlobalLogger")
|
||||
var lock = NSLock()
|
||||
var logger: Logger {
|
||||
get {
|
||||
@@ -26,8 +26,7 @@ var logger: Logger {
|
||||
enum GlobalLoggerBasedSystem {
|
||||
static func main() {
|
||||
// boostrap with our sample implementation
|
||||
let logging = SimpleLogging()
|
||||
Logging.bootstrap(logging.make)
|
||||
Logging.bootstrap(SimpleLogHandler.init)
|
||||
// run the example
|
||||
for i in 1 ... 2 {
|
||||
print("---------------------------- processing request #\(i) ----------------------------")
|
||||
|
||||
Reference in new issue
Block a user