Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.com>2018-10-13 19:23:11 +0300
committergabime <gmelman1@gmail.com>2018-10-13 19:23:11 +0300
commitf2f9f324ec15ac44fd6da859f79cf7aa0ebc97aa (patch)
tree72e26966a13701589b20b61b5a500eb6f52bba1d /example
parent8131d3e127afa105952f7659a23d6c2886408c4f (diff)
Updated default API impl and tests
Diffstat (limited to 'example')
-rw-r--r--example/example.cpp8
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);
}