mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 14:45:31 -07:00
Implement Log Level selector setting.
This commit is contained in:
parent
35d17b8b0b
commit
5ff39c1cb5
2 changed files with 15 additions and 0 deletions
|
@ -346,6 +346,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 = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({sohInputEditorWindow}));
|
||||
context->InitWindow(sohFast3dWindow);
|
||||
|
|
|
@ -85,6 +85,17 @@ void SohMenu::AddMenuDevTools() {
|
|||
}
|
||||
})
|
||||
.SameLine(true);
|
||||
AddWidget(path, "Log Level", WIDGET_CVAR_COMBOBOX)
|
||||
.CVar("gDeveloperTools.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"), 1));
|
||||
})
|
||||
.PreFunc([](WidgetInfo& info) { info.isHidden = mSohMenu->disabledMap.at(DISABLE_FOR_DEBUG_MODE_OFF).active; });
|
||||
|
||||
// Stats
|
||||
path.sidebarName = "Stats";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue