diff options
author | p0358 <p0358@users.noreply.github.com> | 2022-01-02 08:08:01 +0100 |
---|---|---|
committer | p0358 <p0358@users.noreply.github.com> | 2022-01-02 08:08:01 +0100 |
commit | 9cb76890b310fe8872dfbe68a880c75e5eb5a7ac (patch) | |
tree | 728256a8a41c95d9867febb90b69107ac6ead863 /NorthstarDedicatedTest/logging.cpp | |
parent | 664d5d434e8e31f8f74992f2f2b94ffd8a7609c0 (diff) | |
parent | 49acb6d831919022745b68f474b65c19f4e62bcd (diff) | |
download | NorthstarLauncher-9cb76890b310fe8872dfbe68a880c75e5eb5a7ac.tar.gz NorthstarLauncher-9cb76890b310fe8872dfbe68a880c75e5eb5a7ac.zip |
Merge upstream
Diffstat (limited to 'NorthstarDedicatedTest/logging.cpp')
-rw-r--r-- | NorthstarDedicatedTest/logging.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp index 312d5345..7d5f7ae5 100644 --- a/NorthstarDedicatedTest/logging.cpp +++ b/NorthstarDedicatedTest/logging.cpp @@ -203,6 +203,8 @@ void InitialiseLogging() spdlog::default_logger()->sinks().push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(stream.str(), false)); } +ConVar* Cvar_spewlog_enable; + enum SpewType_t { SPEW_MESSAGE = 0, @@ -218,6 +220,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) { @@ -327,4 +332,6 @@ void InitialiseEngineSpewFuncHooks(HMODULE baseAddress) { HookEnabler hook; ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x11CA80, EngineSpewFuncHook, reinterpret_cast<LPVOID*>(&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 |