updated build system
This commit is contained in:
@@ -105,8 +105,12 @@ void iostream_exception_handler::handle_warn(std::string_view function_name,
|
||||
#if defined(PROJECT_ENABLE_SPDLOG) && defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
void spdlog_exception_handler::handle_debug(std::string_view function_name,
|
||||
std::string_view msg) const {
|
||||
spdlog::get("console")->debug(
|
||||
utils::error::create_error_message(function_name, {msg}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->debug(utils::error::create_error_message(function_name, {msg}));
|
||||
} else {
|
||||
fallback.handle_debug(function_name, msg);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -118,8 +122,12 @@ void spdlog_exception_handler::handle_debug(std::string_view function_name,
|
||||
|
||||
void spdlog_exception_handler::handle_error(std::string_view function_name,
|
||||
std::string_view msg) const {
|
||||
spdlog::get("console")->error(
|
||||
utils::error::create_error_message(function_name, {msg}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->error(utils::error::create_error_message(function_name, {msg}));
|
||||
} else {
|
||||
fallback.handle_error(function_name, msg);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -131,11 +139,16 @@ void spdlog_exception_handler::handle_error(std::string_view function_name,
|
||||
|
||||
void spdlog_exception_handler::handle_exception(
|
||||
std::string_view function_name) const {
|
||||
spdlog::get("console")->error(
|
||||
utils::error::create_error_message(function_name, {
|
||||
"exception",
|
||||
"unknown exception",
|
||||
}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->error(utils::error::create_error_message(function_name,
|
||||
{
|
||||
"exception",
|
||||
"unknown exception",
|
||||
}));
|
||||
} else {
|
||||
fallback.handle_exception(function_name);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -151,11 +164,16 @@ void spdlog_exception_handler::handle_exception(
|
||||
|
||||
void spdlog_exception_handler::handle_exception(
|
||||
std::string_view function_name, const std::exception &ex) const {
|
||||
spdlog::get("console")->error(utils::error::create_error_message(
|
||||
function_name, {
|
||||
"exception",
|
||||
(ex.what() == nullptr ? "unknown" : ex.what()),
|
||||
}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->error(utils::error::create_error_message(
|
||||
function_name, {
|
||||
"exception",
|
||||
(ex.what() == nullptr ? "unknown" : ex.what()),
|
||||
}));
|
||||
} else {
|
||||
fallback.handle_exception(function_name, ex);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -171,8 +189,12 @@ void spdlog_exception_handler::handle_exception(
|
||||
|
||||
void spdlog_exception_handler::handle_info(std::string_view function_name,
|
||||
std::string_view msg) const {
|
||||
spdlog::get("console")->info(
|
||||
utils::error::create_error_message(function_name, {msg}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->info(utils::error::create_error_message(function_name, {msg}));
|
||||
} else {
|
||||
fallback.handle_info(function_name, msg);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -184,8 +206,12 @@ void spdlog_exception_handler::handle_info(std::string_view function_name,
|
||||
|
||||
void spdlog_exception_handler::handle_trace(std::string_view function_name,
|
||||
std::string_view msg) const {
|
||||
spdlog::get("console")->trace(
|
||||
utils::error::create_error_message(function_name, {msg}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->trace(utils::error::create_error_message(function_name, {msg}));
|
||||
} else {
|
||||
fallback.handle_trace(function_name, msg);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
@@ -197,8 +223,12 @@ void spdlog_exception_handler::handle_trace(std::string_view function_name,
|
||||
|
||||
void spdlog_exception_handler::handle_warn(std::string_view function_name,
|
||||
std::string_view msg) const {
|
||||
spdlog::get("console")->warn(
|
||||
utils::error::create_error_message(function_name, {msg}));
|
||||
auto console = spdlog::get("console");
|
||||
if (console) {
|
||||
console->warn(utils::error::create_error_message(function_name, {msg}));
|
||||
} else {
|
||||
fallback.handle_warn(function_name, msg);
|
||||
}
|
||||
|
||||
auto file = spdlog::get("file");
|
||||
if (not file) {
|
||||
|
||||
Reference in New Issue
Block a user