Skip to content

Commit e4016e4

Browse files
authored
Merge pull request swiftlang#16 from owenv/owenv/log-forgiveness
Log a fault instead of crashing if default log subsystem is not configured
2 parents 25e423c + ba5e78f commit e4016e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SKLogging/LoggingScope.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public final class LoggingScope {
3131
} else if let defaultSubsystem = defaultSubsystem.value {
3232
return defaultSubsystem
3333
} else {
34-
fatalError("SKLogging: default subsystem was not configured before first use")
34+
Logger(subsystem: "org.swift.sklogging", category: "configuration")
35+
.log(level: .fault, "default logging subsystem was not configured before first use")
36+
return "org.swift"
3537
}
3638
}
3739

0 commit comments

Comments
 (0)