Errors throw, while criticals terminate.

This commit is contained in:
2026-02-03 13:19:59 +02:00
parent f2d429109b
commit bd3be51abd

View File

@@ -13,6 +13,7 @@
#include <chrono> #include <chrono>
#include <cstddef> #include <cstddef>
#include <cstring> #include <cstring>
#include <exception>
#include <format> #include <format>
#include <fstream> #include <fstream>
#include <print> #include <print>
@@ -60,9 +61,12 @@ void Logging::Log(const std::string &message, const std::string &position,
Logging::File.flush(); // Terrible but necessary sadly Logging::File.flush(); // Terrible but necessary sadly
} }
// Error and Critical if (severity == Logging::LogLevel::Error) {
if (severity < Logging::LogLevel::Warning) {
throw std::runtime_error(output); throw std::runtime_error(output);
} }
if (severity == Logging::LogLevel::Critical) {
std::terminate();
}
} }
} }