mirror of
https://github.com/gabime/spdlog.git
synced 2026-04-10 11:34:29 +08:00
Modified from_str() to perform case-insensitive comparison for all level names. This allows environment variables and SPDLOG_LEVEL_NAMES to use uppercase or mixed case level names (e.g., DEBUG, INFO, Warning) while maintaining full backward compatibility with existing lowercase names.
This commit is contained in:
@@ -73,6 +73,17 @@ TEST_CASE("to_level_enum", "[convert_to_level_enum]") {
|
||||
REQUIRE(spdlog::level::from_str("critical") == spdlog::level::critical);
|
||||
REQUIRE(spdlog::level::from_str("off") == spdlog::level::off);
|
||||
REQUIRE(spdlog::level::from_str("null") == spdlog::level::off);
|
||||
REQUIRE(spdlog::level::from_str("TRACE") == spdlog::level::trace);
|
||||
REQUIRE(spdlog::level::from_str("DEBUG") == spdlog::level::debug);
|
||||
REQUIRE(spdlog::level::from_str("INFO") == spdlog::level::info);
|
||||
REQUIRE(spdlog::level::from_str("WARNING") == spdlog::level::warn);
|
||||
REQUIRE(spdlog::level::from_str("WARN") == spdlog::level::warn);
|
||||
REQUIRE(spdlog::level::from_str("ERROR") == spdlog::level::err);
|
||||
REQUIRE(spdlog::level::from_str("ERR") == spdlog::level::err);
|
||||
REQUIRE(spdlog::level::from_str("CRITICAL") == spdlog::level::critical);
|
||||
REQUIRE(spdlog::level::from_str("OFF") == spdlog::level::off);
|
||||
REQUIRE(spdlog::level::from_str("TrAcE") == spdlog::level::trace);
|
||||
REQUIRE(spdlog::level::from_str("DeBuG") == spdlog::level::debug);
|
||||
}
|
||||
|
||||
TEST_CASE("periodic flush", "[periodic_flush]") {
|
||||
|
||||
Reference in New Issue
Block a user