Skip to content

Commit

Permalink
Updated comment about mdc
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Apr 30, 2024
1 parent 2122eb2 commit 3b4fd93
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/spdlog/mdc.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)

#pragma once

#include <map>
#include <string>

#include <spdlog/common.h>

// 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:
Expand Down

0 comments on commit 3b4fd93

Please sign in to comment.