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.

55 lines
1.1 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. class CSDKEventLog : public CEventLog
  12. {
  13. private:
  14. typedef CEventLog BaseClass;
  15. public:
  16. virtual ~CSDKEventLog() {};
  17. public:
  18. bool PrintEvent( IGameEvent * event ) // override virtual function
  19. {
  20. if ( BaseClass::PrintEvent( event ) )
  21. {
  22. return true;
  23. }
  24. if ( Q_strcmp(event->GetName(), "sdk_") == 0 )
  25. {
  26. return PrintSDKEvent( event );
  27. }
  28. return false;
  29. }
  30. protected:
  31. bool PrintSDKEvent( IGameEvent * event ) // print Mod specific logs
  32. {
  33. //const char * name = event->GetName() + Q_strlen("sdk_"); // remove prefix
  34. return false;
  35. }
  36. };
  37. CSDKEventLog g_SDKEventLog;
  38. //-----------------------------------------------------------------------------
  39. // Singleton access
  40. //-----------------------------------------------------------------------------
  41. IGameSystem* GameLogSystem()
  42. {
  43. return &g_SDKEventLog;
  44. }