diff --git a/lib/utilities/SpdLogger.cpp b/lib/utilities/SpdLogger.cpp index fa7430f..c04512d 100644 --- a/lib/utilities/SpdLogger.cpp +++ b/lib/utilities/SpdLogger.cpp @@ -71,6 +71,5 @@ void SpdLogger::ChangeLevel(LogLevel lvl) // you will only get this message for log levels <= info! I.e., not for error or warning. this->logger_->info( - std::format("{}: Changed log level to {}({})", __FUNCTION__, LogLevelToString(lvl), static_cast(lvl)) - .c_str()); + std::format("{}: Changed log level to {}({})", __FUNCTION__, LogLevelToString(lvl), static_cast(lvl))); } diff --git a/src/AppGLFW.cpp b/src/AppGLFW.cpp index 97c46b5..d9f993c 100644 --- a/src/AppGLFW.cpp +++ b/src/AppGLFW.cpp @@ -202,12 +202,12 @@ void pixelarium::ui::AppGLFW::MenuBar() // main menu if (ImGui::BeginMenu(MAINMENUNAME)) { - if (ImGui::BeginCombo(LOGLEVELSELECT, LOGLEVELS[log_level_])) + if (ImGui::BeginCombo(LOGLEVELSELECT, LOGLEVELS[log_level_].data())) { - for (int n = 0; n < IM_ARRAYSIZE(LOGLEVELS); n++) + for (int n = 0; n < static_cast(LOGLEVELS.size()); n++) { bool is_selected = (LOGLEVELS[log_level_] == LOGLEVELS[n]); - if (ImGui::Selectable(LOGLEVELS[n], is_selected)) + if (ImGui::Selectable(LOGLEVELS[n].data(), is_selected)) { log_level_ = n; this->logger_.ChangeLevel(static_cast(1 << log_level_)); diff --git a/src/uiresources.h.in b/src/uiresources.h.in index 15927f7..95f9614 100644 --- a/src/uiresources.h.in +++ b/src/uiresources.h.in @@ -1,6 +1,8 @@ #pragma once /*-- Gets filled in during the cmake configuration step --*/ +#include +#include #cmakedefine PIXELARIUM_TITLE "@PIXELARIUM_TITLE@" #define MAINMENUNAME "Menu" @@ -8,5 +10,4 @@ #define LOGLEVELSELECT "Log Level" #define SHOWIMGUIDEMOS "ImGui Demos" -inline constexpr const char* LOGLEVELS[] = {"Trace", "Debug", "Info", "Warning", "Error"}; - +inline constexpr std::array LOGLEVELS = {"Trace", "Debug", "Info", "Warning", "Error"};