rm c-style array
This commit is contained in:
committed by
Kueffner, Maximilian
parent
3bfec0b13d
commit
35fe3b7181
@@ -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.
|
// you will only get this message for log levels <= info! I.e., not for error or warning.
|
||||||
this->logger_->info(
|
this->logger_->info(
|
||||||
std::format("{}: Changed log level to {}({})", __FUNCTION__, LogLevelToString(lvl), static_cast<int>(lvl))
|
std::format("{}: Changed log level to {}({})", __FUNCTION__, LogLevelToString(lvl), static_cast<int>(lvl)));
|
||||||
.c_str());
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -202,12 +202,12 @@ void pixelarium::ui::AppGLFW::MenuBar()
|
|||||||
// main menu
|
// main menu
|
||||||
if (ImGui::BeginMenu(MAINMENUNAME))
|
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<int>(LOGLEVELS.size()); n++)
|
||||||
{
|
{
|
||||||
bool is_selected = (LOGLEVELS[log_level_] == LOGLEVELS[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;
|
log_level_ = n;
|
||||||
this->logger_.ChangeLevel(static_cast<utils::log::LogLevel>(1 << log_level_));
|
this->logger_.ChangeLevel(static_cast<utils::log::LogLevel>(1 << log_level_));
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*-- Gets filled in during the cmake configuration step --*/
|
/*-- Gets filled in during the cmake configuration step --*/
|
||||||
|
#include <array>
|
||||||
|
#include <string_view>
|
||||||
#cmakedefine PIXELARIUM_TITLE "@PIXELARIUM_TITLE@"
|
#cmakedefine PIXELARIUM_TITLE "@PIXELARIUM_TITLE@"
|
||||||
|
|
||||||
#define MAINMENUNAME "Menu"
|
#define MAINMENUNAME "Menu"
|
||||||
@@ -8,5 +10,4 @@
|
|||||||
#define LOGLEVELSELECT "Log Level"
|
#define LOGLEVELSELECT "Log Level"
|
||||||
#define SHOWIMGUIDEMOS "ImGui Demos"
|
#define SHOWIMGUIDEMOS "ImGui Demos"
|
||||||
|
|
||||||
inline constexpr const char* LOGLEVELS[] = {"Trace", "Debug", "Info", "Warning", "Error"};
|
inline constexpr std::array<std::string_view, 5> LOGLEVELS = {"Trace", "Debug", "Info", "Warning", "Error"};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user