rethrnow non std exceptions to fix #533

pull/1924/head
gabime 4 years ago
parent 8e3b1338a5
commit e9635c7b2d

@ -71,11 +71,12 @@
printf("spdlog fatal error: %s\n", ex.what()); \ printf("spdlog fatal error: %s\n", ex.what()); \
std::abort(); \ std::abort(); \
} while (0) } while (0)
#define SPDLOG_CATCH_ALL() #define SPDLOG_CATCH_STD
#else #else
#define SPDLOG_TRY try #define SPDLOG_TRY try
#define SPDLOG_THROW(ex) throw(ex) #define SPDLOG_THROW(ex) throw(ex)
#define SPDLOG_CATCH_ALL() catch (...) #define SPDLOG_CATCH_STD \
catch (const std::exception &) {}
#endif #endif
namespace spdlog { namespace spdlog {

@ -49,7 +49,7 @@ SPDLOG_INLINE thread_pool::~thread_pool()
t.join(); t.join();
} }
} }
SPDLOG_CATCH_ALL() {} SPDLOG_CATCH_STD
} }
void SPDLOG_INLINE thread_pool::post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy) void SPDLOG_INLINE thread_pool::post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy)

@ -31,7 +31,8 @@
} \ } \
catch (...) \ catch (...) \
{ \ { \
err_handler_("Unknown exception in logger"); \ err_handler_("Rethrowing unknown exception in logger"); \
throw; \
} }
#else #else
#define SPDLOG_LOGGER_CATCH() #define SPDLOG_LOGGER_CATCH()

Loading…
Cancel
Save