mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
report about unknown excepptions before rethrow
This commit is contained in:
parent
ed5498a2e9
commit
6d355fd602
@ -98,6 +98,11 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg)
|
|||||||
{
|
{
|
||||||
_err_handler(ex.what());
|
_err_handler(ex.what());
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
_err_handler("Unknown exception in logger " + _name);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -114,6 +119,11 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg)
|
|||||||
{
|
{
|
||||||
_err_handler(ex.what());
|
_err_handler(ex.what());
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
_err_handler("Unknown exception in logger " + _name);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user