updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
2025-02-19 16:39:37 -06:00
parent c5bdea0c8a
commit 5ae58655a1
2 changed files with 86 additions and 62 deletions

View File

@ -72,89 +72,37 @@ protected:
i_exception_handler() = default;
};
struct iostream_exception_handler final : i_exception_handler {
struct iostream_exception_handler final : public i_exception_handler {
#if defined(PROJECT_ENABLE_V2_ERRORS)
void handle_debug(std::string_view function_name,
std::string_view msg) const override {
std::cout << create_error_message(function_name,
{
"debug",
msg,
})
<< std::endl;
}
std::string_view msg) const override;
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
void handle_error(std::string_view function_name,
std::string_view msg) const override {
std::cerr << create_error_message(function_name,
{
"error",
msg,
})
<< std::endl;
}
std::string_view msg) const override;
void handle_exception(std::string_view function_name) const override {
std::cerr << create_error_message(function_name,
{
"error",
"exception",
"unknown",
})
<< std::endl;
}
void handle_exception(std::string_view function_name) const override;
void handle_exception(std::string_view function_name,
const std::exception &ex) const override {
std::cerr << create_error_message(
function_name,
{
"error",
"exception",
(ex.what() == nullptr ? "unknown" : ex.what()),
})
<< std::endl;
}
const std::exception &ex) const override;
#if defined(PROJECT_ENABLE_V2_ERRORS)
void handle_info(std::string_view function_name,
std::string_view msg) const override {
std::cout << create_error_message(function_name,
{
"info",
msg,
})
<< std::endl;
}
std::string_view msg) const override;
void handle_trace(std::string_view function_name,
std::string_view msg) const override {
std::cout << create_error_message(function_name,
{
"trace",
msg,
})
<< std::endl;
}
std::string_view msg) const override;
void handle_warn(std::string_view function_name,
std::string_view msg) const override {
std::cout << create_error_message(function_name,
{
"warn",
msg,
})
<< std::endl;
}
std::string_view msg) const override;
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
};
inline const iostream_exception_handler default_exception_handler{};
#if defined(PROJECT_ENABLE_TESTING)
extern std::atomic<const i_exception_handler *> exception_handler;
#if defined(PROJECT_ENABLE_TESTING)
[[nodiscard]] inline auto get_exception_handler()
-> const i_exception_handler * {
return exception_handler;