From 89d16c9a8a65e3b4872947c58df1ffd97fc63a4b Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sun, 2 Jan 2022 03:15:05 +0000 Subject: add the ability to disable spewfunc logging --- NorthstarDedicatedTest/logging.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'NorthstarDedicatedTest/logging.cpp') diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp index 7791299d..e13a9150 100644 --- a/NorthstarDedicatedTest/logging.cpp +++ b/NorthstarDedicatedTest/logging.cpp @@ -202,6 +202,8 @@ void InitialiseLogging() spdlog::default_logger()->sinks().push_back(std::make_shared(stream.str(), false)); } +ConVar* Cvar_spewlog_enable; + enum SpewType_t { SPEW_MESSAGE = 0, @@ -217,6 +219,9 @@ EngineSpewFuncType EngineSpewFunc; void EngineSpewFuncHook(void* engineServer, SpewType_t type, const char* format, va_list args) { + if (!Cvar_spewlog_enable->m_nValue) + return; + const char* typeStr; switch (type) { @@ -326,4 +331,6 @@ void InitialiseEngineSpewFuncHooks(HMODULE baseAddress) { HookEnabler hook; ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x11CA80, EngineSpewFuncHook, reinterpret_cast(&EngineSpewFunc)); + + Cvar_spewlog_enable = RegisterConVar("spewlog_enable", "1", FCVAR_NONE, "Enables/disables whether the engine spewfunc should be logged"); } \ No newline at end of file -- cgit v1.2.3