Added noexcept some function in common.h
This commit is contained in:
parent
d0beac70bd
commit
2a7b995723
@ -85,17 +85,17 @@ static const char *level_names[] SPDLOG_LEVEL_NAMES;
|
|||||||
|
|
||||||
static const char *short_level_names[]{"T", "D", "I", "W", "E", "C", "O"};
|
static const char *short_level_names[]{"T", "D", "I", "W", "E", "C", "O"};
|
||||||
|
|
||||||
inline const char *to_c_str(spdlog::level::level_enum l)
|
inline const char *to_c_str(spdlog::level::level_enum l) noexcept
|
||||||
{
|
{
|
||||||
return level_names[l];
|
return level_names[l];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char *to_short_c_str(spdlog::level::level_enum l)
|
inline const char *to_short_c_str(spdlog::level::level_enum l) noexcept
|
||||||
{
|
{
|
||||||
return short_level_names[l];
|
return short_level_names[l];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline spdlog::level::level_enum from_str(const std::string &name)
|
inline spdlog::level::level_enum from_str(const std::string &name) noexcept
|
||||||
{
|
{
|
||||||
static std::unordered_map<std::string, level_enum> name_to_level = // map string->level
|
static std::unordered_map<std::string, level_enum> name_to_level = // map string->level
|
||||||
{{level_names[0], level::trace}, // trace
|
{{level_names[0], level::trace}, // trace
|
||||||
|
Loading…
Reference in New Issue
Block a user