diff --git a/include/spdlog/common.h b/include/spdlog/common.h index cfcf3f36..14fbb7e0 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -42,13 +42,6 @@ #define SPDLOG_DEPRECATED #endif -#if defined(__linux__) && !defined(__ANDROID__) -#include -#define SPDLOG_CATCH_ALL catch (abi::__forced_unwind&) { _err_handler("Unknown exception"); throw; } catch (...) -#else // __linux__ -#define SPDLOG_CATCH_ALL catch (...) -#endif // __linux__ - #include "fmt/fmt.h" namespace spdlog diff --git a/include/spdlog/details/async_log_helper.h b/include/spdlog/details/async_log_helper.h index fa5cc78b..c7c5f860 100644 --- a/include/spdlog/details/async_log_helper.h +++ b/include/spdlog/details/async_log_helper.h @@ -279,11 +279,7 @@ inline void spdlog::details::async_log_helper::worker_loop() catch (const std::exception &ex) { _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } + } } if (_worker_teardown_cb) _worker_teardown_cb(); diff --git a/include/spdlog/details/async_logger_impl.h b/include/spdlog/details/async_logger_impl.h index 9ca73fb0..3964c5ab 100644 --- a/include/spdlog/details/async_logger_impl.h +++ b/include/spdlog/details/async_logger_impl.h @@ -97,9 +97,5 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg) catch (const std::exception &ex) { _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } + } } diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index c0d38796..bd7ead80 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -76,11 +76,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar catch (const std::exception &ex) { _err_handler(ex.what()); - } - SPDLOG_CATCH_ALL - { - _err_handler("Unknown exception"); - } + } } template @@ -96,12 +92,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg) catch (const std::exception &ex) { _err_handler(ex.what()); - } - SPDLOG_CATCH_ALL - { - _err_handler("Unknown exception"); - } - + } } template @@ -117,11 +108,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg) catch (const std::exception &ex) { _err_handler(ex.what()); - } - SPDLOG_CATCH_ALL - { - _err_handler("Unknown exception"); - } + } } @@ -571,4 +558,3 @@ inline const std::vector& spdlog::logger::sinks() const return _sinks; } -#undef SPDLOG_CATCH_ALL