Skip to content

Commit 28b7bc0

Browse files
committed
[Foundation] Extract logging details to a standalone function
(cherry picked from commit 505d87c)
1 parent 4ae36b8 commit 28b7bc0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stdlib/public/Darwin/Foundation/CheckClass.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ private func _isClassFirstSeen(_ theClass: AnyClass) -> Bool {
2323
}
2424
}
2525

26+
internal func _logRuntimeIssue(_ message: String) {
27+
NSLog("%@", message)
28+
_swift_reportToDebugger(0, message, nil)
29+
}
30+
2631
extension NSKeyedUnarchiver {
2732
/// Checks if class `theClass` is good for archiving.
2833
///
@@ -56,8 +61,7 @@ extension NSKeyedUnarchiver {
5661
If there are no existing archives containing this class, you should choose a unique, prefixed name instead:
5762
"@objc(ABCMyModel)"
5863
"""
59-
NSLog("%@", message)
60-
_swift_reportToDebugger(0, message, nil)
64+
_logRuntimeIssue(message)
6165
}
6266
return 1
6367
}

0 commit comments

Comments
 (0)