mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
atyle
This commit is contained in:
parent
efc8de6d64
commit
4efbd950d6
@ -80,7 +80,10 @@ int main(int, char*[])
|
||||
err_handler_example();
|
||||
|
||||
// Apply a function on all registered loggers
|
||||
spd::apply_all([&](std::shared_ptr<spdlog::logger> l) {l->info("End of example."); });
|
||||
spd::apply_all([&](std::shared_ptr<spdlog::logger> l)
|
||||
{
|
||||
l->info("End of example.");
|
||||
});
|
||||
|
||||
// Release and close all loggers
|
||||
spdlog::drop_all();
|
||||
|
@ -32,7 +32,10 @@ TEST_CASE("apply_all" "[registry]")
|
||||
spdlog::register_logger(logger2);
|
||||
|
||||
int counter = 0;
|
||||
spdlog::apply_all([&counter](std::shared_ptr<spdlog::logger> l){counter++;});
|
||||
spdlog::apply_all([&counter](std::shared_ptr<spdlog::logger> l)
|
||||
{
|
||||
counter++;
|
||||
});
|
||||
REQUIRE(counter == 2);
|
||||
|
||||
counter = 0;
|
||||
@ -40,7 +43,8 @@ TEST_CASE("apply_all" "[registry]")
|
||||
spdlog::apply_all([&counter](std::shared_ptr<spdlog::logger> l)
|
||||
{
|
||||
REQUIRE(l->name() == tested_logger_name);
|
||||
counter++; }
|
||||
counter++;
|
||||
}
|
||||
);
|
||||
REQUIRE(counter == 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user