You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.2 KiB
61 lines
1.2 KiB
//========= Copyright Valve Corporation, All rights reserved. ============// |
|
// |
|
// Purpose: |
|
// |
|
// $NoKeywords: $ |
|
// |
|
//=============================================================================// |
|
#include "cbase.h" |
|
#include "../EventLog.h" |
|
#include "KeyValues.h" |
|
|
|
// memdbgon must be the last include file in a .cpp file!!! |
|
#include "tier0/memdbgon.h" |
|
|
|
class CHL2EventLog : public CEventLog |
|
{ |
|
private: |
|
typedef CEventLog BaseClass; |
|
|
|
public: |
|
virtual char const *Name() { return "CHL2EventLog"; } |
|
|
|
virtual ~CHL2EventLog() {}; |
|
|
|
public: |
|
bool PrintEvent( IGameEvent * event ) // override virtual function |
|
{ |
|
if ( BaseClass::PrintEvent( event ) ) |
|
{ |
|
return true; |
|
} |
|
|
|
if ( Q_strcmp(event->GetName(), "hl2_") == 0 ) |
|
{ |
|
return PrintHL2Event( event ); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
protected: |
|
|
|
bool PrintHL2Event( IGameEvent * event ) // print Mod specific logs |
|
{ |
|
// const char * name = event->GetName() + Q_strlen("hl2_"); // remove prefix |
|
|
|
return false; |
|
} |
|
|
|
}; |
|
|
|
static CHL2EventLog s_HL2EventLog; |
|
|
|
//----------------------------------------------------------------------------- |
|
// Singleton access |
|
//----------------------------------------------------------------------------- |
|
IGameSystem* GameLogSystem() |
|
{ |
|
return &s_HL2EventLog; |
|
} |
|
|
|
|