mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
catch(...) exceptions, report it, and rethrow
This commit is contained in:
@@ -279,7 +279,13 @@ inline void spdlog::details::async_log_helper::worker_loop()
|
|||||||
catch (const std::exception &ex)
|
catch (const std::exception &ex)
|
||||||
{
|
{
|
||||||
_err_handler(ex.what());
|
_err_handler(ex.what());
|
||||||
}
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
_err_handler("Unknown exeption in worker loop. Terminating worker loop");
|
||||||
|
active = false;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_worker_teardown_cb) _worker_teardown_cb();
|
if (_worker_teardown_cb) _worker_teardown_cb();
|
||||||
|
|
||||||
|
@@ -97,5 +97,11 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg)
|
|||||||
catch (const std::exception &ex)
|
catch (const std::exception &ex)
|
||||||
{
|
{
|
||||||
_err_handler(ex.what());
|
_err_handler(ex.what());
|
||||||
}
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
_err_handler("Unknown exception in logger " + _name);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -76,6 +76,10 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar
|
|||||||
catch (const std::exception &ex)
|
catch (const std::exception &ex)
|
||||||
{
|
{
|
||||||
_err_handler(ex.what());
|
_err_handler(ex.what());
|
||||||
|
}
|
||||||
|
catch(...) {
|
||||||
|
_err_handler("Unknown exception in logger " + _name);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user