Fix logging implementation error

This commit is contained in:
topjohnwu
2025-10-02 04:03:08 -07:00
committed by John Wu
parent d60806f429
commit d6f17c42d5
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -10,6 +10,7 @@
#include <string>
#include <base.hpp>
#include <flags.h>
using namespace std;
+1 -1
View File
@@ -76,7 +76,7 @@ fn log_with_writer<F: FnOnce(LogWriter)>(level: LogLevel, f: F) {
return;
}
f(logger.write);
if logger.flags.contains(LogFlag::EXIT_ON_ERROR) {
if matches!(level, LogLevel::Error) && logger.flags.contains(LogFlag::EXIT_ON_ERROR) {
exit(-1);
}
}