From 70d0e873282c3ff73b2029f5ecad22219a03cf5f Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 22 Jun 2016 00:36:34 +0300 Subject: [PATCH] example update --- README.md | 10 +++++----- example/example.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d9a6af3a..571727e8 100644 --- a/README.md +++ b/README.md @@ -92,15 +92,15 @@ int main(int, char* []) // // Create a basic multithreaded file logger (use "file_logger_st" for the single threaded version) // - auto simple_logger = spd::file_logger_mt("basic_logger", "logs/simple.txt"); - simple_logger->info("Some log message"); + auto my_logger = spd::file_logger_mt("basic_logger", "logs/basic.txt"); + my_logger->info("Some log message"); // // Create a file rotating logger with 5mb size max and 3 rotated files // - auto file_logger = spd::rotating_logger_mt("file_logger", "logs/mylogfile", 1048576 * 5, 3); + auto rotating_logger = spd::rotating_logger_mt("some_logger_name", "logs/mylogfile", 1048576 * 5, 3); for(int i = 0; i < 10; ++i) - file_logger->info("{} * {} equals {:>10}", i, i, i*i); + rotating_logger->info("{} * {} equals {:>10}", i, i, i*i); // // Create a daily logger - a new file is created every day on 2:30am @@ -111,7 +111,7 @@ int main(int, char* []) // Customize msg format for all messages // spd::set_pattern("*** [%H:%M:%S %z] [thread %t] %v ***"); - file_logger->info("This is another message with custom format"); + rotating_logger->info("This is another message with custom format"); spd::get("console")->info("loggers can be retrieved from a global registry using the spdlog::get(logger_name) function"); diff --git a/example/example.cpp b/example/example.cpp index fa34254f..e3d22dbb 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -44,21 +44,21 @@ int main(int, char*[]) console->debug("This message shold be displayed.."); // Create basic file logger (not rotated) - auto simple_logger = spd::basic_logger_mt("basic_logger", "logs/simple.txt"); - simple_logger->info("Some log message"); + auto my_logger = spd::basic_logger_mt("basic_logger", "logs/basic.txt"); + my_logger->info("Some log message"); // Create a file rotating logger with 5mb size max and 3 rotated files - auto file_logger = spd::rotating_logger_mt("file_logger", "logs/mylogfile", 1048576 * 5, 3); + auto rotating_logger = spd::rotating_logger_mt("some_logger_name", "logs/mylogfile", 1048576 * 5, 3); for (int i = 0; i < 10; ++i) - file_logger->info("{} * {} equals {:>10}", i, i, i*i); + rotating_logger->info("{} * {} equals {:>10}", i, i, i*i); // Create a daily logger - a new file is created every day on 2:30am auto daily_logger = spd::daily_logger_mt("daily_logger", "logs/daily", 2, 30); // Customize msg format for all messages spd::set_pattern("*** [%H:%M:%S %z] [thread %t] %v ***"); - file_logger->info("This is another message with custom format"); + rotating_logger->info("This is another message with custom format"); // Compile time debug or trace macros.