Errors throw, while criticals terminate.
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user