From b4fab4bd64aedec80ef635a9e1d06d71e8447522 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Fri, 23 Jun 2017 23:12:58 -0600 Subject: [PATCH] Change u8 to ClassType and fix an issue with the latest spdlog on not MSVC --- src/common/logging/backend_spdlog.cpp | 6 ++++-- src/common/logging/formatter.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/logging/backend_spdlog.cpp b/src/common/logging/backend_spdlog.cpp index 297f91e70..fe332ad99 100644 --- a/src/common/logging/backend_spdlog.cpp +++ b/src/common/logging/backend_spdlog.cpp @@ -79,7 +79,8 @@ SpdLogBackend::SpdLogBackend() { sinks.push_back(std::move(color_sink)); // register all of loggers with spdlog - for (u8 log_class = 0; log_class != static_cast(Log::Class::Count); ++log_class) { + for (ClassType log_class = 0; log_class != static_cast(Log::Class::Count); + ++log_class) { loggers[log_class] = spdlog::create(GetLogClassName(static_cast(log_class)), begin(sinks), end(sinks)); } @@ -101,7 +102,8 @@ void SpdLogImpl(Class log_class, Level log_level, const char* file, int line_num void SpdLogSetFilter(Filter* filter) { auto loggers = SpdLogBackend::Instance()->GetLoggers(); auto class_level = filter->GetClassLevel(); - for (u8 log_class = 0; log_class != static_cast(Log::Class::Count); ++log_class) { + for (ClassType log_class = 0; log_class != static_cast(Log::Class::Count); + ++log_class) { loggers[log_class]->set_level(GetSpdLogLevel(class_level[log_class])); } } diff --git a/src/common/logging/formatter.cpp b/src/common/logging/formatter.cpp index 52b091c1e..397e2f248 100644 --- a/src/common/logging/formatter.cpp +++ b/src/common/logging/formatter.cpp @@ -9,7 +9,7 @@ namespace Log { -static const char* GetLevelName(spdlog::level_t log_level) { +static const char* GetLevelName(spdlog::level::level_enum log_level) { switch (log_level) { case spdlog::level::trace: return "Trace";