Leaked source code of windows server 2003
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.

43 lines
991 B

  1. // LOGUTIL.h
  2. #ifndef _LOGUTIL_H__INCLUDED_
  3. #define _LOGUTIL_H__INCLUDED_
  4. #include <windows.h>
  5. class CLogging;
  6. extern CLogging g_log;
  7. #define LOG g_log.Log
  8. #define LOGINIT g_log.Init
  9. #define LOGFILE( _file ) CLogging g_log( _file )
  10. #define LOGFILEEX( _file, _path ) CLogging g_log( _file, _path )
  11. #define LOGSIZE( _FileSizeLow ) g_log.Size( _FileSizeLow )
  12. class CLogging
  13. {
  14. private:
  15. LPTSTR m_psLogFile;
  16. LPTSTR m_psDefaultPath;
  17. HINSTANCE m_hInstance;
  18. bool m_bInitialized;
  19. bool m_bSkipDefaultPath;
  20. void LogPrivate( LPCTSTR szBuffer );
  21. public:
  22. CLogging( LPCTSTR ps );
  23. CLogging( LPCTSTR ps, LPCTSTR psPath );
  24. ~CLogging( void );
  25. void Init( HINSTANCE hinst );
  26. void Initialize( void );
  27. void SetFile( LPCTSTR psLogFile );
  28. void __cdecl Log( int iMessageId, ... );
  29. void __cdecl Log( LPCTSTR lpszFormat, ... );
  30. void Size( DWORD _FileSizeLow );
  31. void SkipDefaultPath( void );
  32. };
  33. #endif // _LOGUTIL_H__INCLUDED_