Team Fortress 2 Source Code as on 22/4/2020
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

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "cbase.h"
  9. #include "../EventLog.h"
  10. #include "KeyValues.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include "tier0/memdbgon.h"
  13. class CHL2EventLog : public CEventLog
  14. {
  15. private:
  16. typedef CEventLog BaseClass;
  17. public:
  18. virtual char const *Name() { return "CHL2EventLog"; }
  19. virtual ~CHL2EventLog() {};
  20. public:
  21. bool PrintEvent( IGameEvent * event ) // override virtual function
  22. {
  23. if ( BaseClass::PrintEvent( event ) )
  24. {
  25. return true;
  26. }
  27. if ( Q_strcmp(event->GetName(), "hl2_") == 0 )
  28. {
  29. return PrintHL2Event( event );
  30. }
  31. return false;
  32. }
  33. protected:
  34. bool PrintHL2Event( IGameEvent * event ) // print Mod specific logs
  35. {
  36. // const char * name = event->GetName() + Q_strlen("hl2_"); // remove prefix
  37. return false;
  38. }
  39. };
  40. static CHL2EventLog s_HL2EventLog;
  41. //-----------------------------------------------------------------------------
  42. // Singleton access
  43. //-----------------------------------------------------------------------------
  44. IGameSystem* GameLogSystem()
  45. {
  46. return &s_HL2EventLog;
  47. }