Feature 3379 (#3397)

* Fix #3379

* clang format
This commit is contained in:
Gabi Melman
2025-05-08 14:02:00 +03:00
committed by GitHub
parent 548b264254
commit 7e022c4300
24 changed files with 300 additions and 225 deletions

View File

@@ -269,7 +269,7 @@ void multi_sink_example() {
struct my_type {
int i = 0;
explicit my_type(int i)
: i(i){}
: i(i) {}
};
#ifndef SPDLOG_USE_STD_FORMAT // when using fmtlib
@@ -382,14 +382,14 @@ void replace_default_logger_example() {
spdlog::set_default_logger(old_logger);
}
// Mapped Diagnostic Context (MDC) is a map that stores key-value pairs (string values) in thread local storage.
// Each thread maintains its own MDC, which loggers use to append diagnostic information to log outputs.
// Note: it is not supported in asynchronous mode due to its reliance on thread-local storage.
// Mapped Diagnostic Context (MDC) is a map that stores key-value pairs (string values) in thread
// local storage. Each thread maintains its own MDC, which loggers use to append diagnostic
// information to log outputs. Note: it is not supported in asynchronous mode due to its reliance on
// thread-local storage.
#ifndef SPDLOG_NO_TLS
#include "spdlog/mdc.h"
void mdc_example()
{
void mdc_example() {
spdlog::mdc::put("key1", "value1");
spdlog::mdc::put("key2", "value2");
// if not using the default format, you can use the %& formatter to print mdc data as well