mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-29 19:18:58 -07:00
Implement Log Level selector setting (#5263)
* Implement Log Level selector setting. * run clang * Enum for default value. * PR feedback: use CVAR_DEVELOPER_TOOLS in CVar builder. * Slight change to try to force a PR update. * screw you clang
This commit is contained in:
parent
ca32dfd246
commit
ae480e107e
2 changed files with 15 additions and 0 deletions
|
@ -332,6 +332,10 @@ OTRGlobals::OTRGlobals() {
|
||||||
context->InitCrashHandler();
|
context->InitCrashHandler();
|
||||||
context->InitConsole();
|
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 =
|
auto sohInputEditorWindow =
|
||||||
std::make_shared<SohInputEditorWindow>(CVAR_WINDOW("ControllerConfiguration"), "Configure Controller");
|
std::make_shared<SohInputEditorWindow>(CVAR_WINDOW("ControllerConfiguration"), "Configure Controller");
|
||||||
auto sohFast3dWindow =
|
auto sohFast3dWindow =
|
||||||
|
|
|
@ -87,6 +87,17 @@ void SohMenu::AddMenuDevTools() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.SameLine(true);
|
.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
|
// Stats
|
||||||
path.sidebarName = "Stats";
|
path.sidebarName = "Stats";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue