Skip to content

Commit

Permalink
C4LogSystem: make sure the debug logger exists before setting its lev…
Browse files Browse the repository at this point in the history
…el as it won't exist if the engine prematurely exits due to a startup error
  • Loading branch information
Fulgen301 committed Nov 14, 2024
1 parent 101ed9a commit 746a906
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/C4Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ std::shared_ptr<spdlog::logger> C4LogSystem::GetOrCreate(std::string name, C4Log

void C4LogSystem::EnableDebugLog(const bool enable)
{
loggerDebugGuiSink->set_level(enable ? spdlog::level::debug : spdlog::level::off);
if (loggerDebugGuiSink)
{
loggerDebugGuiSink->set_level(enable ? spdlog::level::debug : spdlog::level::off);
}
}

void C4LogSystem::SetVerbose(const bool verbose)
Expand Down

0 comments on commit 746a906

Please sign in to comment.