diff --git a/include/spdlog/mdc.h b/include/spdlog/mdc.h index 1713c820..41f0c1f3 100644 --- a/include/spdlog/mdc.h +++ b/include/spdlog/mdc.h @@ -1,3 +1,6 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + #pragma once #include @@ -5,6 +8,13 @@ #include +// MDC is a simple map of key->string values stored in thread local storage whose content will be printed by the loggers. +// Note: Not supported in async mode (thread local storage - so the async thread pool have different copy). +// +// Usage example: +// spdlog::mdc::put("mdc_key_1", "mdc_value_1"); +// spdlog::info("Hello, {}", "World!"); // => [2024-04-26 02:08:05.040] [info] [mdc_key_1:mdc_value_1] Hello, World! + namespace spdlog { class SPDLOG_API mdc { public: