Commit 4efbd950 authored by gabime's avatar gabime

atyle

parent efc8de6d
...@@ -80,7 +80,10 @@ int main(int, char*[]) ...@@ -80,7 +80,10 @@ int main(int, char*[])
err_handler_example(); err_handler_example();
// Apply a function on all registered loggers // 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 // Release and close all loggers
spdlog::drop_all(); spdlog::drop_all();
......
...@@ -32,7 +32,10 @@ TEST_CASE("apply_all" "[registry]") ...@@ -32,7 +32,10 @@ TEST_CASE("apply_all" "[registry]")
spdlog::register_logger(logger2); spdlog::register_logger(logger2);
int counter = 0; 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); REQUIRE(counter == 2);
counter = 0; counter = 0;
...@@ -40,7 +43,8 @@ TEST_CASE("apply_all" "[registry]") ...@@ -40,7 +43,8 @@ TEST_CASE("apply_all" "[registry]")
spdlog::apply_all([&counter](std::shared_ptr<spdlog::logger> l) spdlog::apply_all([&counter](std::shared_ptr<spdlog::logger> l)
{ {
REQUIRE(l->name() == tested_logger_name); REQUIRE(l->name() == tested_logger_name);
counter++; } counter++;
}
); );
REQUIRE(counter == 1); REQUIRE(counter == 1);
} }
......
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