Skip to content

Commit cec5577

Browse files
committed
Add logs around various exits
1 parent 69a7a93 commit cec5577

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/swift-driver/main.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,30 +155,41 @@ do {
155155
// FIXME: The following check should be at the end of Driver.init, but current
156156
// usage of the DiagnosticVerifier in tests makes this difficult.
157157
guard !driver.diagnosticEngine.hasErrors else {
158+
print("DRIVER EXTRA VERBOSE HAD ERRORS")
158159
throw Driver.ErrorDiagnostics.emitted
159160
}
160161

162+
print("DRIVER EXTRA VERBOSE STARTING PLANNING")
161163
let jobs = try driver.planBuild()
164+
print("DRIVER EXTRA VERBOSE FINISHED PLANNING")
162165

163166
// Planning may result in further errors emitted
164167
// due to dependency scanning failures.
165168
guard !driver.diagnosticEngine.hasErrors else {
169+
print("DRIVER EXTRA VERBOSE HAD ERRORS")
166170
throw Driver.ErrorDiagnostics.emitted
167171
}
168172

173+
print("DRIVER EXTRA VERBOSE RUNNING JOBS")
169174
try driver.run(jobs: jobs)
175+
print("DRIVER EXTRA VERBOSE FINISHED JOBS")
170176

171177
if driver.diagnosticEngine.hasErrors {
178+
print("DRIVER EXTRA VERBOSE HAD ERRORS")
172179
exit(getExitCode(EXIT_FAILURE))
173180
}
174181

182+
print("DRIVER EXTRA VERBOSE SUCCESS")
175183
exit(getExitCode(0))
176184
} catch let diagnosticData as DiagnosticData {
185+
print("DRIVER EXTRA VERBOSE IN CATCH FOR DIAGNOSTIC EMISSION")
177186
diagnosticsEngine.emit(.error(diagnosticData))
178187
exit(getExitCode(EXIT_FAILURE))
179188
} catch Driver.ErrorDiagnostics.emitted {
189+
print("DRIVER EXTRA VERBOSE IN CATCH FOR ALREADY EMITTED DIAGNOSTICS")
180190
exit(getExitCode(EXIT_FAILURE))
181191
} catch {
192+
print("DRIVER EXTRA VERBOSE IN CATCH FOR OTHER ERROR")
182193
print("error: \(error)")
183194
exit(getExitCode(EXIT_FAILURE))
184195
}

0 commit comments

Comments
 (0)