From 7b57efae422656b4f247bc0741e20fb77ffcae01 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Wed, 30 Aug 2023 16:55:01 -0700 Subject: [PATCH] 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. --- .../SyntaxParsable+ExpressibleByStringInterpolation.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift b/Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift index cf0153ec307..370d8a4a8c8 100644 --- a/Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift +++ b/Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift @@ -51,7 +51,7 @@ extension SyntaxParseable { """ Parsing a `\(Self.self)` node from string interpolation produced the following parsing errors. Set a breakpoint in `SyntaxParseable.logStringInterpolationParsingError()` to debug the failure. - \(formattedDiagnostics) + \(formattedDiagnostics, privacy: .private) """ ) }