diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index 802532a69..2141b550b 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -349,6 +349,16 @@ extern std::shared_ptr mActorViewerWindow; extern std::shared_ptr mCollisionViewerWindow; extern std::shared_ptr mEventLogWindow; +const char* logLevels[] = { + "trace", + "debug", + "info", + "warn", + "error", + "critical", + "off", +}; + void DrawDeveloperToolsMenu() { if (UIWidgets::BeginMenu("Developer Tools", UIWidgets::Colors::Yellow)) { UIWidgets::CVarCheckbox("Debug Mode", "gDeveloperTools.DebugEnabled", { @@ -365,6 +375,12 @@ void DrawDeveloperToolsMenu() { if (UIWidgets::CVarCheckbox("Prevent Actor Init", "gDeveloperTools.PreventActorInit")) { RegisterPreventActorInitHooks(); } + if (UIWidgets::CVarCombobox("Log Level", "gDeveloperTools.LogLevel", logLevels, { + .tooltip = "The log level determines which messages are printed to the console. This does not affect the log file output", + .defaultIndex = 1, + })) { + LUS::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); + } if (gPlayState != NULL) { ImGui::Separator(); diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp index d83f2fc36..e3f018749 100644 --- a/mm/2s2h/BenPort.cpp +++ b/mm/2s2h/BenPort.cpp @@ -130,6 +130,11 @@ OTRGlobals::OTRGlobals() { OOT_PAL_GC, OOT_PAL_GC_DBG1, OOT_PAL_GC_DBG2 }; // tell LUS to reserve 3 SoH specific threads (Game, Audio, Save) context = LUS::Context::CreateInstance("2 Ship 2 Harkinian", appShortName, "shipofharkinian.json", OTRFiles, {}, 3); + + // Override LUS defaults + LUS::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); + LUS::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v"); + //context = LUS::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json"); auto loader = context->GetResourceManager()->GetResourceLoader(); loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, diff --git a/mm/src/audio/lib/thread.c b/mm/src/audio/lib/thread.c index 94a0d4585..403098a28 100644 --- a/mm/src/audio/lib/thread.c +++ b/mm/src/audio/lib/thread.c @@ -270,8 +270,6 @@ void AudioThread_QueueCmd(AudioCmd cmdData) { AudioCmd* cmd = &gAudioCtx.threadCmdBuf[gAudioCtx.threadCmdWritePos & 0xFF]; *cmd = cmdData; - LUSLOG_TRACE("Queueing Command: %s", cmd_op_to_str(cmd->op)); - gAudioCtx.threadCmdWritePos++; if (gAudioCtx.threadCmdWritePos == gAudioCtx.threadCmdReadPos) { @@ -467,7 +465,7 @@ void AudioThread_ProcessCmds(u32 msg) { } cmd = &gAudioCtx.threadCmdBuf[sCurCmdRdPos++ & 0xFF]; - LUSLOG_TRACE("Process Command: %s", cmd_op_to_str(cmd->op)); + if (cmd->op == AUDIOCMD_OP_GLOBAL_STOP_AUDIOCMDS) { gAudioCtx.threadCmdQueueFinished = true; break;