Skip to content

Commit 9fbfa46

Browse files
committed
Mark redactedDescription as @objc
Otherwise os_log can’t find the property and won’t respect it.
1 parent a9242f8 commit 9fbfa46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/LSPLogging/CustomLogStringConvertible.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public class CustomLogStringConvertibleWrapper: NSObject {
4141
return underlyingObject.description
4242
}
4343

44+
#if canImport(os)
45+
// When using OSLog mark redactedDescription as @objc so that OSLog can find it via the Objective-C runtime.
46+
// We can't unconditionally mark it as @objc because eg. Linux doesn't have the Objective-C runtime.
47+
@objc
48+
#endif
4449
public var redactedDescription: String {
4550
underlyingObject.redactedDescription
4651
}

0 commit comments

Comments
 (0)