Skip to content

Commit 7b57efa

Browse files
committed
Set the privacy level of string interpolation errors in os_log to private
If string interpolation results in parsing errors, we create an os_log fault to notify the user about a potential bug. This log message contains the source code with the syntax error, which could be sensitive. Set the os_log privacy level to `private` to make sure the source code does not get persisted in logs. It will still show up in the Xcode console.
1 parent 057bdfb commit 7b57efa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extension SyntaxParseable {
5151
"""
5252
Parsing a `\(Self.self)` node from string interpolation produced the following parsing errors.
5353
Set a breakpoint in `SyntaxParseable.logStringInterpolationParsingError()` to debug the failure.
54-
\(formattedDiagnostics)
54+
\(formattedDiagnostics, privacy: .private)
5555
"""
5656
)
5757
}

0 commit comments

Comments
 (0)