Skip to content

Commit 0d9dcb1

Browse files
committed
Swift: auto-flush logs at exit
1 parent 182a155 commit 0d9dcb1

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

swift/extractor/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,5 @@ int main(int argc, char** argv, char** envp) {
227227
observer.markSuccessfullyExtractedFiles();
228228
}
229229

230-
codeql::Log::flush();
231-
232230
return frontend_rc;
233231
}

swift/logging/SwiftLogging.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class Log {
110110
Level level;
111111
};
112112

113+
~Log() { flushImpl(); }
114+
113115
// Flush logs to the designated outputs
114116
static void flush() { instance().flushImpl(); }
115117

swift/xcode-autobuilder/XcodeBuildRunner.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ void buildTarget(Target& target, bool dryRun) {
6565
if (!exec(argv)) {
6666
DIAGNOSE_ERROR(build_command_failed, "The detected build command failed (tried {})",
6767
absl::StrJoin(argv, " "));
68-
codeql::Log::flush();
6968
exit(1);
7069
}
7170
}

0 commit comments

Comments
 (0)