mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
enforce that logging system can only be bootstrapped once (#32)
motivation: safer logging system changes: do a precondition check to verify logging syste is only initialized/bootstrapped once per process
This commit is contained in:
1 parent
045ba36718
commit
c7583429a6
11 files changed
+47
-26
No files matched your search
@@ -2,7 +2,6 @@
|
||||
// THIS IS NOT PART OF THE PITCH, JUST AN EXAMPLE HOW A LOGGER USAGE LOOKS LIKE
|
||||
//
|
||||
|
||||
import ExampleImplementation
|
||||
import Foundation
|
||||
import Logging
|
||||
|
||||
@@ -25,8 +24,6 @@ var logger: Logger {
|
||||
// this is a contrived example of a system that shares one global logger
|
||||
enum GlobalLoggerBasedSystem {
|
||||
static func main() {
|
||||
// boostrap with our sample implementation
|
||||
LoggingSystem.bootstrap(SimpleLogHandler.init)
|
||||
// run the example
|
||||
for i in 1 ... 2 {
|
||||
print("---------------------------- processing request #\(i) ----------------------------")
|
||||
|
||||
Reference in new issue
Block a user