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:
David Hart authored and Johannes Weiss committed 2019-02-18 20:27:59 +01:00
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) ----------------------------")