diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index 8aeb249c..f8928046 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -397,20 +397,23 @@ void CheckCPU() // Respawn's engine and our SDK utilize POPCNT, SSE3 and SSSE3 ( void DetourInit() // Run the sigscan { - const bool bLogAdr = CommandLine()->CheckParm("-sig_toconsole") ? true : false; const bool bNoSmap = CommandLine()->CheckParm("-nosmap") ? true : false; + const bool bLogAdr = CommandLine()->CheckParm("-sig_toconsole") ? true : false; bool bInitDivider = false; g_SigCache.SetDisabled(bNoSmap); g_SigCache.LoadCache(SIGDB_FILE); + // No debug logging in non dev builds. + const bool bDevMode = !IsCert() && !IsRetail(); + for (const IDetour* Detour : g_DetourVec) { Detour->GetCon(); // Constants. Detour->GetFun(); // Functions. Detour->GetVar(); // Variables. - if (bLogAdr) + if (bDevMode && bLogAdr) { if (!bInitDivider) { @@ -429,7 +432,7 @@ void DetourInit() // Run the sigscan g_SigCache.WriteCache(SIGDB_FILE); g_SigCache.InvalidateMap(); -} + } void DetourAddress() // Test the sigscan results { diff --git a/r5dev/tier0/tier0_iface.cpp b/r5dev/tier0/tier0_iface.cpp index b08675b6..2eb2cc05 100644 --- a/r5dev/tier0/tier0_iface.cpp +++ b/r5dev/tier0/tier0_iface.cpp @@ -22,13 +22,31 @@ static const char* const s_AdrFmt = "| {:s}: {:42s}: {:#18x} |\n"; void LogFunAdr(const char* const szFun, const uintptr_t nAdr) // Logging function addresses. { - spdlog::debug(s_AdrFmt, "FUN", szFun, nAdr); + if (!IsCert() && !IsRetail()) + spdlog::debug(s_AdrFmt, "FUN", szFun, nAdr); + else + { + NOTE_UNUSED(szFun); + NOTE_UNUSED(nAdr); + } } void LogVarAdr(const char* const szVar, const uintptr_t nAdr) // Logging variable addresses. { - spdlog::debug(s_AdrFmt, "VAR", szVar, nAdr); + if (!IsCert() && !IsRetail()) + spdlog::debug(s_AdrFmt, "VAR", szVar, nAdr); + else + { + NOTE_UNUSED(szVar); + NOTE_UNUSED(nAdr); + } } void LogConAdr(const char* const szCon, const uintptr_t nAdr) // Logging constant addresses. { - spdlog::debug(s_AdrFmt, "CON", szCon, nAdr); + if (!IsCert() && !IsRetail()) + spdlog::debug(s_AdrFmt, "CON", szCon, nAdr); + else + { + NOTE_UNUSED(szCon); + NOTE_UNUSED(nAdr); + } }