1
0
mirror of https://github.com/gabime/spdlog.git synced 2025-01-16 01:37:58 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Gabi Melman
98388d18de
Update README.md 2020-04-26 19:55:58 +03:00
Gabi Melman
bbc5753b96
Update README.md 2020-04-26 19:53:58 +03:00
Gabi Melman
564eecaa3b
Update README.md 2020-04-26 19:50:33 +03:00
Gabi Melman
0480920058
Update README.md 2020-04-26 19:49:12 +03:00

View File

@ -108,7 +108,7 @@ void basic_logfile_example()
{
try
{
auto my_logger = spdlog::basic_logger_mt("basic_logger", "logs/basic-log.txt");
auto logger = spdlog::basic_logger_mt("basic_logger", "logs/basic-log.txt");
}
catch (const spdlog::spdlog_ex &ex)
{
@ -125,7 +125,7 @@ void rotating_example()
// Create a file rotating logger with 5mb size max and 3 rotated files
auto max_size = 1048576 * 5;
auto max_files = 3;
auto rotating_logger = spdlog::rotating_logger_mt("some_logger_name", "logs/rotating.txt", max_size, max_files);
auto logger = spdlog::rotating_logger_mt("some_logger_name", "logs/rotating.txt", max_size, max_files);
}
```
@ -137,7 +137,7 @@ void rotating_example()
void daily_example()
{
// Create a daily logger - a new file is created every day on 2:30am
auto daily_logger = spdlog::daily_logger_mt("daily_logger", "logs/daily.txt", 2, 30);
auto logger = spdlog::daily_logger_mt("daily_logger", "logs/daily.txt", 2, 30);
}
```
@ -147,7 +147,8 @@ void daily_example()
```c++
// Loggers can store in a ring buffer all messages (including debug/trace) and display later on demand.
// When needed, call dump_backtrace() to see them
spdlog::enable_backtrace(32); // create ring buffer with capacity of 32 messages
spdlog::enable_backtrace(32); // Store the latest 32 messages in a buffer. Older messages will be dropped.
// or my_logger->enable_backtrace(32)..
for(int i = 0; i < 100; i++)
{