From c01c98ef83cdca7587a07ce48dd8501952ec9b13 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Wed, 13 Sep 2023 16:11:33 -0700 Subject: [PATCH] Print environment variables for commands executed by `swift-syntax-dev-utils` Environment variables are as much input to the executed subprocess as the parameters and we should be logging them as well in verbose mode. --- .../Sources/swift-syntax-dev-utils/common/Logger.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/Logger.swift b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/Logger.swift index 82a7af95492..ec9733fc0cd 100644 --- a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/Logger.swift +++ b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/Logger.swift @@ -20,6 +20,10 @@ extension Process { var command: String { var message = "" + for (key, value) in environment?.sorted(by: { $0.key < $1.key }) ?? [] { + message += "\(key)='\(value)' " + } + if let executableURL = executableURL { message += executableURL.path }