diff options
author | gabime <gmelman1@gmail.com> | 2018-10-13 19:23:11 +0300 |
---|---|---|
committer | gabime <gmelman1@gmail.com> | 2018-10-13 19:23:11 +0300 |
commit | f2f9f324ec15ac44fd6da859f79cf7aa0ebc97aa (patch) | |
tree | 72e26966a13701589b20b61b5a500eb6f52bba1d /example | |
parent | 8131d3e127afa105952f7659a23d6c2886408c4f (diff) |
Updated default API impl and tests
Diffstat (limited to 'example')
-rw-r--r-- | example/example.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/example/example.cpp b/example/example.cpp index df89ae56..15ca856e 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -23,7 +23,7 @@ void syslog_example(); void clone_example(); #define SPDLOG_TRACE_ON -#define SPDLOG_DEBUG_ON + #include "spdlog/spdlog.h" int main(int, char *[]) @@ -115,7 +115,7 @@ void daily_example() // Useful for creating component/subsystem loggers from some "root" logger. void clone_example() { - auto network_logger = spdlog::get()->clone("network"); + auto network_logger = spdlog::default_logger()->clone("network"); network_logger->info("Logging network stuff.."); } @@ -156,10 +156,10 @@ void binary_example() } // Compile time log levels. -// Must define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON to turn them on. +// Must define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON before including spdlog.h to turn them on. void trace_example() { - auto logger = spdlog::get(); + auto logger = spdlog::get("file_logger"); SPDLOG_TRACE(logger, "Enabled only #ifdef SPDLOG_TRACE_ON..{} ,{}", 1, 3.23); SPDLOG_DEBUG(logger, "Enabled only #ifdef SPDLOG_DEBUG_ON.. {} ,{}", 1, 3.23); } |