From c6d558b6f26287a4b3cd06e2d9973c082293b13f Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Tue, 27 Aug 2019 02:20:17 +0300 Subject: [PATCH 1/4] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4fcef570..af41614f 100644 --- a/README.md +++ b/README.md @@ -137,15 +137,17 @@ void daily_example() ``` --- -#### Cloning loggers +#### Backtrace support ```c++ -// clone a logger and give it new name. -// Useful for creating subsystem loggers from some "root" logger -void clone_example() +// Loggers can store in a ring buffer all messages (including debug/trace) for later inspection. +// When needed, call dump_backtrace() to see what happened: +spdlog::enable_backtrace(32); // create ring buffer with capacity of 32 messages +for(int i = 0; i < 100; i++) { - auto network_logger = spdlog::get("root")->clone("network"); - network_logger->info("Logging network stuff.."); + spdlog::debug("Backtrace message {}", i); // not logged yet.. } +// e.g. if some error happened: +spdlog::dump_backtrace(); // log them now! ``` --- From a2de7cf0707fc305e082ff82b361f389abcbfe3e Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Tue, 27 Aug 2019 02:23:22 +0300 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index af41614f..359a25c2 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Very fast, header-only/compiled, C++ logging library. [![Build Status](https://t * Very fast (see [benchmarks](#benchmarks) below). * Headers only, just copy and use. Or use as a compiled library. * Feature rich formatting, using the excellent [fmt](https://github.com/fmtlib/fmt) library. +* Backtrace support - save latest debugging messages for later inspection. * Fast asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Multi/Single threaded loggers. From 2ba7d1639ed78f0e7f580ab2988b803b53c2a57d Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Tue, 27 Aug 2019 02:26:28 +0300 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 359a25c2..dd011aa8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Very fast, header-only/compiled, C++ logging library. [![Build Status](https://t * Very fast (see [benchmarks](#benchmarks) below). * Headers only, just copy and use. Or use as a compiled library. * Feature rich formatting, using the excellent [fmt](https://github.com/fmtlib/fmt) library. -* Backtrace support - save latest debugging messages for later inspection. +* [Backtrace](#backtrace-support) support - save latest debugging messages for later inspection. * Fast asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Multi/Single threaded loggers. From 15faf742f1f9afc49184d30a04fdffea52d81c78 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Tue, 27 Aug 2019 02:27:21 +0300 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd011aa8..6ff4be59 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Very fast, header-only/compiled, C++ logging library. [![Build Status](https://t * Very fast (see [benchmarks](#benchmarks) below). * Headers only, just copy and use. Or use as a compiled library. * Feature rich formatting, using the excellent [fmt](https://github.com/fmtlib/fmt) library. -* [Backtrace](#backtrace-support) support - save latest debugging messages for later inspection. +* [Backtrace](#backtrace-support) support - store debugging messages in a ring buffer for later inspection. * Fast asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Multi/Single threaded loggers.