mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Catch exceptions from async logger. Fix #2618
This commit is contained in:
@@ -185,6 +185,14 @@ TEST_CASE("to_file multi-workers", "[async]")
|
||||
logger->info("Hello message #{}", j);
|
||||
}
|
||||
}
|
||||
|
||||
require_message_count(TEST_FILENAME, messages);
|
||||
}
|
||||
|
||||
TEST_CASE("bad_tp", "[async]")
|
||||
{
|
||||
auto test_sink = std::make_shared<spdlog::sinks::test_sink_mt>();
|
||||
std::shared_ptr<spdlog::details::thread_pool> const empty_tp;
|
||||
auto logger = std::make_shared<spdlog::async_logger>("as", test_sink, empty_tp);
|
||||
logger->info("Please throw an exception");
|
||||
REQUIRE(test_sink->msg_counter() == 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user