Counter Strike : Global Offensive Source Code
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.

71 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // sv_log.h
  9. // Server logging functions
  10. #ifndef SV_LOG_H
  11. #define SV_LOG_H
  12. #pragma once
  13. #include <igameevents.h>
  14. #include "netadr.h"
  15. class CLog : public IGameEventListener2
  16. {
  17. public:
  18. CLog();
  19. virtual ~CLog();
  20. public: // IGameEventListener Interface
  21. void FireGameEvent( IGameEvent *event );
  22. int m_nDebugID;
  23. int GetEventDebugID( void );
  24. public:
  25. bool IsActive( void ); // true if logging is "on"
  26. void SetLoggingState( bool state ); // set the logging state to true (on) or false (off)
  27. bool UsingLogAddress( void );
  28. bool AddLogAddress( netadr_t addr, uint64 ullToken = 0ull );
  29. bool DelLogAddress( netadr_t addr );
  30. void DelAllLogAddress( void );
  31. void ListLogAddress( void );
  32. void Open( void ); // opens logging file
  33. void Close( void ); // closes logging file
  34. void Init( void );
  35. void Reset( void ); // reset all logging streams
  36. void Shutdown( void );
  37. void Printf( PRINTF_FORMAT_STRING const char *fmt, ... ) FMTFUNCTION( 2, 3 ); // log a line to log file
  38. void Print( const char * text );
  39. void PrintServerVars( void ); // prints server vars to log file
  40. void RunFrame();
  41. private:
  42. bool m_bActive; // true if we're currently logging
  43. struct LogAddressDestination_t
  44. {
  45. netadr_t m_adr;
  46. uint64 m_ullToken;
  47. };
  48. CUtlVector< LogAddressDestination_t > m_LogAddrDestinations; // Server frag log stream is sent to the address(es) in this list
  49. FileHandle_t m_hLogFile; // File where frag log is put.
  50. double m_flLastLogFlush;
  51. bool m_bFlushLog;
  52. };
  53. extern CLog g_Log;
  54. #endif // SV_LOG_H