This commit is contained in:
Malkierian 2025-04-27 14:34:33 +01:00 committed by GitHub
commit f84226d708
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -330,6 +330,10 @@ OTRGlobals::OTRGlobals() {
context->InitCrashHandler();
context->InitConsole();
Ship::Context::GetInstance()->GetLogger()->set_level(
(spdlog::level::level_enum)CVarGetInteger(CVAR_DEVELOPER_TOOLS("LogLevel"), 1));
Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v");
auto sohInputEditorWindow =
std::make_shared<SohInputEditorWindow>(CVAR_WINDOW("ControllerConfiguration"), "Configure Controller");
auto sohFast3dWindow =

View file

@ -87,6 +87,17 @@ void SohMenu::AddMenuDevTools() {
}
})
.SameLine(true);
AddWidget(path, "Log Level", WIDGET_CVAR_COMBOBOX)
.CVar(CVAR_DEVELOPER_TOOLS("LogLevel"))
.Options(ComboboxOptions()
.Tooltip("The log level determines which messages are printed to the "
"console. This does not affect the log file output")
.ComboMap(logLevels))
.Callback([](WidgetInfo& info) {
Ship::Context::GetInstance()->GetLogger()->set_level(
(spdlog::level::level_enum)CVarGetInteger(CVAR_DEVELOPER_TOOLS("LogLevel"), DEBUG_LOG_DEBUG));
})
.PreFunc([](WidgetInfo& info) { info.isHidden = mSohMenu->disabledMap.at(DISABLE_FOR_DEBUG_MODE_OFF).active; });
// Stats
path.sidebarName = "Stats";