Replies: 3 comments 1 reply
-
Right. This is a known issue with the async logger (#1696). I would just put small sleep before the assert (ugly but effective). |
Beta Was this translation helpful? Give feedback.
0 replies
-
Another way, using spdlog::apply_all([](std::shared_ptr<logger> logger)
{
for (auto &sink : logger->sinks()) {
sink->flush();
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
The problem it would be executed before the async queue processed fully. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/gabime/spdlog/wiki/7.-Flush-policy
I want to use a spdlog async logger in my
boost::assertion_failed_msg
implementation.spdlog::shutdown()
is not appropriate in this case, I want logging to continue if debugging is continued.I call
spdlog::flush_on()
appropriately, but it seems like there is no way to cause the async logger to flush to output before the program is halted by theassert(false)
.Beta Was this translation helpful? Give feedback.
All reactions