Skip to content

[DNM] Add some verbose logging #8917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Sources/Build/LLBuildProgressTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@ final class LLBuildProgressTracker: LLBuildBuildSystemDelegate, SwiftCompilerOut
result: CommandExtendedResult
) {
// FIXME: This should really happen at the command-level and is just a stopgap measure.
let shouldFilterOutput = !self.logLevel.isVerbose && command.verboseDescription.hasPrefix("codesign ") && result
.result != .failed
let shouldFilterOutput = !self.logLevel.isVerbose
self.queue.async {
if let buffer = self.nonSwiftMessageBuffers[command.name], !shouldFilterOutput {
self.progressAnimation.clear()
self.outputStream.send("EXTRA VERBOSE [exit status \(result.exitStatus)] \(command.verboseDescription): ")
self.outputStream.send(buffer)
self.outputStream.flush()
self.nonSwiftMessageBuffers[command.name] = nil
Expand Down Expand Up @@ -628,8 +628,14 @@ extension SwiftCompilerMessage {
fileprivate var verboseProgressText: String? {
switch kind {
case .began(let info):
([info.commandExecutable] + info.commandArguments).joined(separator: " ")
case .skipped, .finished, .abnormal, .signalled, .unparsableOutput:
"EXTRA VERBOSE [\(info.pid)]: \(([info.commandExecutable] + info.commandArguments).joined(separator: " "))"
case .finished(let info),
.abnormal(let info),
.signalled(let info):
"EXTRA VERBOSE [\(info.pid)]: \(info.output ?? "no output")"
case .unparsableOutput(let output):
"EXTRA VERBOSE [unknown PID]: \(output)"
case .skipped:
nil
}
}
Expand Down