Commit 7a9781a9 authored by gabime's avatar gabime

throw spdlog_err on format errors

parent f41d989b
...@@ -574,10 +574,17 @@ inline void spdlog::pattern_formatter::handle_flag(char flag) ...@@ -574,10 +574,17 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
inline void spdlog::pattern_formatter::format(details::log_msg& msg) inline void spdlog::pattern_formatter::format(details::log_msg& msg)
{ {
try
{
for (auto &f : _formatters) for (auto &f : _formatters)
{ {
f->format(msg); f->format(msg);
} }
//write eol //write eol
msg.formatted.write(details::os::eol(), details::os::eol_size()); msg.formatted.write(details::os::eol(), details::os::eol_size());
}
catch(const fmt::FormatError& e)
{
throw spdlog_ex(fmt::format("formatting error while processing format string: {}", e.what()));
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment