V2.x no reg (#3285)

Removed registry
This commit is contained in:
Gabi Melman
2024-12-06 19:21:42 +02:00
committed by GitHub
parent ed6919bf8e
commit 166843ff3a
52 changed files with 308 additions and 1336 deletions

View File

@@ -15,8 +15,7 @@
TEST_CASE("debug and trace w/o format string", "[macros]") {
prepare_logdir();
spdlog::filename_t filename = SPDLOG_FILENAME_T(TEST_FILENAME);
auto logger = spdlog::create<spdlog::sinks::basic_file_sink_mt>("logger", filename);
auto logger = spdlog::basic_logger_mt("logger", filename);
logger->set_pattern("%v");
logger->set_level(spdlog::level::trace);
@@ -28,8 +27,8 @@ TEST_CASE("debug and trace w/o format string", "[macros]") {
REQUIRE(ends_with(file_contents(TEST_FILENAME), spdlog::fmt_lib::format("Test message 2{}", default_eol)));
REQUIRE(count_lines(TEST_FILENAME) == 1);
auto orig_default_logger = spdlog::default_logger();
spdlog::set_default_logger(logger);
auto orig_global_logger = spdlog::global_logger();
spdlog::set_global_logger(logger);
SPDLOG_TRACE("Test message 3");
SPDLOG_DEBUG("Test message {}", 4);
@@ -37,7 +36,7 @@ TEST_CASE("debug and trace w/o format string", "[macros]") {
require_message_count(TEST_FILENAME, 2);
REQUIRE(ends_with(file_contents(TEST_FILENAME), spdlog::fmt_lib::format("Test message 4{}", default_eol)));
spdlog::set_default_logger(std::move(orig_default_logger));
spdlog::set_global_logger(std::move(orig_global_logger));
}
TEST_CASE("disable param evaluation", "[macros]") {
@@ -45,7 +44,7 @@ TEST_CASE("disable param evaluation", "[macros]") {
}
TEST_CASE("pass logger pointer", "[macros]") {
auto logger = spdlog::create<spdlog::sinks::null_sink_mt>("refmacro");
auto logger = spdlog::null_logger_mt("refmacro");
auto &ref = *logger;
SPDLOG_LOGGER_TRACE(&ref, "Test message 1");
SPDLOG_LOGGER_DEBUG(&ref, "Test message 2");