catch exceptions during flush and cal handler

This commit is contained in:
gabime
2018-05-22 21:59:14 +03:00
parent d0b8ecb6dd
commit cf63bcb808
2 changed files with 34 additions and 8 deletions

View File

@@ -278,7 +278,18 @@ inline spdlog::log_err_handler spdlog::logger::error_handler()
inline void spdlog::logger::flush()
{
_flush();
try
{
_flush();
}
catch (const std::exception &ex)
{
_err_handler(ex.what());
}
catch (...)
{
_err_handler("Unknown exception in logger during flush: " + _name);
}
}
inline void spdlog::logger::flush_on(level::level_enum log_level)