Skip to content

Commit ba5e78f

Browse files
committed
Log a fault instead of crashing if default log subsystem is not configured
1 parent 45095d1 commit ba5e78f

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)