Update README.md

This commit is contained in:
Gabi Melman 2023-01-12 10:15:58 +01:00 committed by GitHub
parent c92d12bc18
commit 05e3a73b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,15 +148,14 @@ void daily_example()
// This is useful in order to display debug logs only when really needed (e.g. when error happens). // This is useful in order to display debug logs only when really needed (e.g. when error happens).
// When needed, call dump_backtrace() to dump them to your log. // When needed, call dump_backtrace() to dump them to your log.
spdlog::enable_backtrace(32); // Store the latest 32 messages in a buffer. Older messages will be dropped. spdlog::enable_backtrace(32); // Store the latest 32 messages in a buffer.
// or my_logger->enable_backtrace(32).. // or my_logger->enable_backtrace(32)..
for(int i = 0; i < 100; i++) for(int i = 0; i < 100; i++)
{ {
spdlog::debug("Backtrace message {}", i); // not logged yet.. spdlog::debug("Backtrace message {}", i); // not logged yet..
} }
// e.g. if some error happened: // e.g. if some has error happened:
spdlog::dump_backtrace(); // log them now! show the last 32 messages spdlog::dump_backtrace(); // log them now! show the last 32 messages
// or my_logger->dump_backtrace(32).. // or my_logger->dump_backtrace(32)..
``` ```