Skip to content

Commit e939ba9

Browse files
committed
Made logging compatible with Swift 6
1 parent 52d58b1 commit e939ba9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/InterposeKit/Interpose.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,22 @@ public enum Interpose {
8585
// MARK: Logging
8686
// ============================================================================ //
8787

88-
/// The flag indicating whether logging is enabled.
89-
public static var isLoggingEnabled = false
88+
/// The flag that enables logging of InterposeKit internal operations to standard output
89+
/// using the `print(…)` function. Defaults to `false`.
90+
///
91+
/// It is recommended to set this flag only once early in your application lifecycle,
92+
/// e.g. at app startup or in test setup.
93+
public nonisolated(unsafe) static var isLoggingEnabled = false
9094

91-
internal static func log(
95+
internal nonisolated static func log(
9296
_ message: @autoclosure () -> String
9397
) {
9498
if self.isLoggingEnabled {
9599
print("[InterposeKit] \(message())")
96100
}
97101
}
98102

99-
internal static func fail(
103+
internal nonisolated static func fail(
100104
_ message: @autoclosure () -> String
101105
) -> Never {
102106
fatalError("[InterposeKit] \(message())")

0 commit comments

Comments
 (0)