mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Aceept also 'warn' string in level::from_str()
This commit is contained in:
parent
04d0240f8d
commit
3a61dcd360
@ -34,7 +34,8 @@ SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG
|
||||
}
|
||||
level++;
|
||||
}
|
||||
return level::off;
|
||||
// allow warn = warning before giving up
|
||||
return name == "warn" ? level::warn: level::off;
|
||||
}
|
||||
} // namespace level
|
||||
|
||||
|
@ -72,6 +72,7 @@ TEST_CASE("to_level_enum", "[convert_to_level_enum]")
|
||||
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("critical") == spdlog::level::critical);
|
||||
REQUIRE(spdlog::level::from_str("off") == spdlog::level::off);
|
||||
|
Loading…
Reference in New Issue
Block a user