2023-05-10 00:05:38 +02:00
|
|
|
//===========================================================================//
|
|
|
|
//
|
|
|
|
// Purpose: Low-level tier0 interface.
|
|
|
|
//
|
|
|
|
//===========================================================================//
|
|
|
|
#include "core/logdef.h"
|
|
|
|
#include "common/sdkdefs.h"
|
|
|
|
#include "tier0/module.h"
|
|
|
|
// Module handles; user is responsible for initializing these.
|
|
|
|
|
|
|
|
CModule g_GameDll;
|
|
|
|
CModule g_SDKDll;
|
|
|
|
|
|
|
|
CModule g_RadVideoToolsDll;
|
|
|
|
CModule g_RadAudioDecoderDll;
|
|
|
|
CModule g_RadAudioSystemDll;
|
|
|
|
|
|
|
|
string g_LogSessionUUID;
|
|
|
|
string g_LogSessionDirectory;
|
|
|
|
|
2023-10-08 15:52:16 +02:00
|
|
|
static const char* const s_AdrFmt = "| {:s}: {:42s}: {:#18x} |\n";
|
2023-05-10 00:05:38 +02:00
|
|
|
|
2024-01-02 15:21:36 +01:00
|
|
|
void LogFunAdr(const char* const szFun, const void* const pAdr) // Logging function addresses.
|
2023-05-10 00:05:38 +02:00
|
|
|
{
|
2023-10-15 10:32:35 +02:00
|
|
|
if (!IsCert() && !IsRetail())
|
2024-01-02 15:21:36 +01:00
|
|
|
spdlog::debug(s_AdrFmt, "FUN", szFun, uintptr_t(pAdr));
|
2023-10-15 10:32:35 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
NOTE_UNUSED(szFun);
|
2024-01-02 15:21:36 +01:00
|
|
|
NOTE_UNUSED(pAdr);
|
2023-10-15 10:32:35 +02:00
|
|
|
}
|
2023-05-10 00:05:38 +02:00
|
|
|
}
|
2024-01-02 15:21:36 +01:00
|
|
|
void LogVarAdr(const char* const szVar, const void* const pAdr) // Logging variable addresses.
|
2023-05-10 00:05:38 +02:00
|
|
|
{
|
2023-10-15 10:32:35 +02:00
|
|
|
if (!IsCert() && !IsRetail())
|
2024-01-02 15:21:36 +01:00
|
|
|
spdlog::debug(s_AdrFmt, "VAR", szVar, uintptr_t(pAdr));
|
2023-10-15 10:32:35 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
NOTE_UNUSED(szVar);
|
2024-01-02 15:21:36 +01:00
|
|
|
NOTE_UNUSED(pAdr);
|
2023-10-15 10:32:35 +02:00
|
|
|
}
|
2023-05-10 00:05:38 +02:00
|
|
|
}
|
2024-01-02 15:21:36 +01:00
|
|
|
void LogConAdr(const char* const szCon, const void* const pAdr) // Logging constant addresses.
|
2023-05-10 00:05:38 +02:00
|
|
|
{
|
2023-10-15 10:32:35 +02:00
|
|
|
if (!IsCert() && !IsRetail())
|
2024-01-02 15:21:36 +01:00
|
|
|
spdlog::debug(s_AdrFmt, "CON", szCon, uintptr_t(pAdr));
|
2023-10-15 10:32:35 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
NOTE_UNUSED(szCon);
|
2024-01-02 15:21:36 +01:00
|
|
|
NOTE_UNUSED(pAdr);
|
2023-10-15 10:32:35 +02:00
|
|
|
}
|
2023-05-10 00:05:38 +02:00
|
|
|
}
|