Revert "Swift: auto-flush logs at exit"

This reverts commit 0d9dcb161f.

This turns out to introduce a subtle bug related to destruction order
between `Log::instance()` and the `Logger` instances.
This commit is contained in:
Paolo Tranquilli
2023-05-09 13:08:28 +02:00
parent 8f26c7e2d2
commit 2904aa8439
3 changed files with 3 additions and 2 deletions

View File

@@ -227,5 +227,7 @@ int main(int argc, char** argv, char** envp) {
observer.markSuccessfullyExtractedFiles();
}
codeql::Log::flush();
return frontend_rc;
}

View File

@@ -110,8 +110,6 @@ class Log {
Level level;
};
~Log() { flushImpl(); }
// Flush logs to the designated outputs
static void flush() { instance().flushImpl(); }

View File

@@ -72,6 +72,7 @@ void buildTarget(Target& target, bool dryRun) {
if (!exec(argv)) {
DIAGNOSE_ERROR(build_command_failed, "The detected build command failed (tried {})",
absl::StrJoin(argv, " "));
codeql::Log::flush();
exit(1);
}
}