Commit 2894e8de authored by gabime's avatar gabime

clang format

parent 74c10df1
...@@ -23,6 +23,7 @@ void syslog_example(); ...@@ -23,6 +23,7 @@ void syslog_example();
int main(int, char *[]) int main(int, char *[])
{ {
try try
{ {
// console logging example // console logging example
...@@ -52,8 +53,8 @@ int main(int, char *[]) ...@@ -52,8 +53,8 @@ int main(int, char *[])
// apply some function on all registered loggers // apply some function on all registered loggers
spdlog::apply_all([&](std::shared_ptr<spdlog::logger> l) { l->info("End of example."); }); spdlog::apply_all([&](std::shared_ptr<spdlog::logger> l) { l->info("End of example."); });
// Release and close all loggers // release any threads created by spdlog, and drop all loggers in the registry.
spdlog::drop_all(); spdlog::shutdown();
} }
// Exceptions will only be thrown upon failed logger or sink construction (not during logging) // Exceptions will only be thrown upon failed logger or sink construction (not during logging)
catch (const spdlog::spdlog_ex &ex) catch (const spdlog::spdlog_ex &ex)
...@@ -69,7 +70,7 @@ void stdout_example() ...@@ -69,7 +70,7 @@ void stdout_example()
{ {
// create color multi threaded logger // create color multi threaded logger
auto console = spdlog::stdout_color_mt("console"); auto console = spdlog::stdout_color_mt("console");
console->info("Welcome to spdlog!"); console->info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH);
console->error("Some error message with arg: {}", 1); console->error("Some error message with arg: {}", 1);
auto err_logger = spdlog::stderr_color_mt("stderr"); auto err_logger = spdlog::stderr_color_mt("stderr");
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/registry.h" #include "spdlog/details/registry.h"
#include "spdlog/logger.h" #include "spdlog/logger.h"
#include "spdlog/version.h"
#include <chrono> #include <chrono>
#include <functional> #include <functional>
......
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