mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184)
Co-authored-by: dyf <yufeng.duan@senscape.com.cn>
This commit is contained in:
@@ -26,7 +26,11 @@
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/async.h"
|
||||
#include "spdlog/details/fmt_helper.h"
|
||||
#include "spdlog/mdc.h"
|
||||
|
||||
#ifndef SPDLOG_NO_TLS
|
||||
#include "spdlog/mdc.h"
|
||||
#endif
|
||||
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#include "spdlog/sinks/daily_file_sink.h"
|
||||
#include "spdlog/sinks/null_sink.h"
|
||||
|
@@ -501,6 +501,7 @@ TEST_CASE("override need_localtime", "[pattern_formatter]") {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SPDLOG_NO_TLS
|
||||
TEST_CASE("mdc formatter test-1", "[pattern_formatter]") {
|
||||
spdlog::mdc::put("mdc_key_1", "mdc_value_1");
|
||||
spdlog::mdc::put("mdc_key_2", "mdc_value_2");
|
||||
@@ -628,3 +629,4 @@ TEST_CASE("mdc empty", "[pattern_formatter]") {
|
||||
|
||||
SECTION("Tear down") { spdlog::mdc::clear(); }
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user