11#include " stdafx.hpp"
22
3- #include " tier0/platform.h"
43#include " hooks.hpp"
4+ #include " tier0/ICommandLine.h"
5+ #include " tier0/platform.h"
56
67HOOK_EXPORT_DECLARE ( hkCOM_TimestampedLog );
78
@@ -39,7 +40,7 @@ NOINLINE void hkCOM_TimestampedLog( char const* fmt, ... )
3940HOOK_EXPORT_DECLARE ( hkMsg );
4041
4142NOINLINE void hkMsg ( const tchar* pMsg, ... )
42- {
43+ {
4344 va_list va;
4445 va_start ( va, pMsg );
4546 vprintf ( pMsg, va );
@@ -49,7 +50,7 @@ NOINLINE void hkMsg( const tchar* pMsg, ... )
4950HOOK_EXPORT_DECLARE ( hkWarning );
5051
5152NOINLINE void hkWarning ( const tchar* pMsg, ... )
52- {
53+ {
5354 va_list va;
5455 va_start ( va, pMsg );
5556 vprintf ( pMsg, va );
@@ -71,7 +72,12 @@ void HookTier0()
7172 const uintptr_t dwTierBase = g_ModuleList.Get ( " tier0.dll" );
7273 BytePatchTier ( dwTierBase );
7374
74- HOOK_EXPORT ( " COM_TimestampedLog" , L" tier0.dll" , hkCOM_TimestampedLog );
75+ // only hook COM_TimestampedLog if we are actually going to use it
76+ if ( CommandLine ()->CheckParm ( " -timestamped" , nullptr ) )
77+ {
78+ HOOK_EXPORT ( " COM_TimestampedLog" , L" tier0.dll" , hkCOM_TimestampedLog );
79+ }
80+
7581 HOOK_EXPORT ( " Msg" , L" tier0.dll" , hkMsg );
7682 HOOK_EXPORT ( " Warning" , L" tier0.dll" , hkWarning );
7783}
0 commit comments