mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-29 03:53:54 +00:00
Compare commits
No commits in common. "87133ef6b7e36913abfaaddf89af309f5f142650" and "0a92d1d68400dca11e8ac584e597a17864312034" have entirely different histories.
87133ef6b7
...
0a92d1d684
@ -7,9 +7,6 @@
|
|||||||
#include <spdlog/common.h>
|
#include <spdlog/common.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace level {
|
namespace level {
|
||||||
|
|
||||||
@ -34,10 +31,15 @@ SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOE
|
|||||||
|
|
||||||
SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT
|
SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT
|
||||||
{
|
{
|
||||||
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
|
int level = 0;
|
||||||
if (it != std::end(level_string_views))
|
for (const auto &level_str : level_string_views)
|
||||||
return static_cast<level::level_enum>(std::distance(std::begin(level_string_views), it));
|
{
|
||||||
|
if (level_str == name)
|
||||||
|
{
|
||||||
|
return static_cast<level::level_enum>(level);
|
||||||
|
}
|
||||||
|
level++;
|
||||||
|
}
|
||||||
// check also for "warn" and "err" before giving up..
|
// check also for "warn" and "err" before giving up..
|
||||||
if (name == "warn")
|
if (name == "warn")
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user