mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
catch exceptions during flush and cal handler
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user