Fix logging implementation error

This commit is contained in:
topjohnwu
2025-10-01 10:46:13 -07:00
committed by John Wu
parent d60806f429
commit d6f17c42d5
3 changed files with 3 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
#include <string>
#include <base.hpp>
#include <flags.h>
using namespace std;

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);
}
}

View File

@@ -7,6 +7,7 @@
#include <cil/cil.h>
#include <base.hpp>
#include <flags.h>
using namespace std;