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.

67 lines
1.3 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. CEventLogger.h
  5. Abstract:
  6. This file contains the header file for the CEventLogger class which is
  7. used to log events across threads and processes.
  8. Revision History:
  9. Eugene Mesgar (eugenem) 6/16/99
  10. created
  11. ******************************************************************************/
  12. #ifndef __EVENTLOGGER__
  13. #define __EVENTLOGGER__
  14. #define TRIM_AT_SIZE 200000
  15. #define NEW_FILE_SIZE 100000
  16. #define MAX_BUFFER 1024
  17. /*
  18. * Logging Levels
  19. */
  20. #define LEVEL_DEBUG 5
  21. #define LEVEL_DETAILED 4
  22. #define LEVEL_NORMAL 3
  23. #define LEVEL_SPARSE 2
  24. #define LEVEL_NONE 0
  25. #define ERROR_CRITICAL 1
  26. #define ERROR_NORMAL 3
  27. #define ERROR_DEBUG 5
  28. class CEventLogger
  29. {
  30. HANDLE m_hSemaphore;
  31. // brijeshk : don't need a handle member, as we open and close the log file everytime we log to it
  32. // HANDLE m_hLogFile;
  33. LPTSTR m_pszFileName;
  34. DWORD m_dwLoggingLevel;
  35. static LPCTSTR m_aszERROR_LEVELS[];
  36. public:
  37. DWORD Init(LPCTSTR pszFileName, DWORD dwLogLevel);
  38. DWORD Init(LPCTSTR pszFileName);
  39. DWORD LogEvent(DWORD dwEventLevel, LPCTSTR pszEventDesc, BOOL fPopUp);
  40. CEventLogger();
  41. virtual ~CEventLogger();
  42. private:
  43. BOOL TruncateFileSize();
  44. };
  45. #endif