Source code of Windows XP (NT5)
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.

57 lines
1.8 KiB

  1. //#pragma title( "TEvent.hpp - Log events" )
  2. /*
  3. Copyright (c) 1995-1998, Mission Critical Software, Inc. All rights reserved.
  4. ===============================================================================
  5. Module - TEvent.hpp
  6. System - EnterpriseAdministrator
  7. Author - Rich Denham
  8. Created - 1995-11-16
  9. Description - TErrorEventLog derived class.
  10. Updates -
  11. ===============================================================================
  12. */
  13. #ifndef MCSINC_TEvent_hpp
  14. #define MCSINC_TEvent_hpp
  15. // Start of header file dependencies
  16. #include "ErrDct.hpp"
  17. #ifndef MCSINC_UString_hpp
  18. #include "UString.hpp"
  19. #endif
  20. // End of header file dependencies
  21. class TErrorEventLog : public TErrorDct
  22. {
  23. private:
  24. HANDLE hEventSource;
  25. public:
  26. TErrorEventLog(
  27. WCHAR const * server ,// in -UNC name of server
  28. WCHAR const * subkey ,// in -event log subkey name
  29. int displevel = 0,// in -mimimum severity level to display
  30. int loglevel = 0 ,// in -mimimum severity level to log
  31. int logmode = 0 ,// in -0=replace, 1=append
  32. int beeplevel = 100 // in -min error level for beeping
  33. ) : TErrorDct( displevel, loglevel, logmode, beeplevel )
  34. {
  35. hEventSource = RegisterEventSourceW( server, subkey );
  36. }
  37. ~TErrorEventLog() { LogClose(); }
  38. virtual BOOL LogOpen(
  39. WCHAR const * fileName ,// in -name of file including any path
  40. int mode = 0 ,// in -0=overwrite, 1=append
  41. int level = 0 // in -minimum level to log
  42. );
  43. virtual void LogWrite(WCHAR const * msg);
  44. virtual void LogClose();
  45. };
  46. #endif // MCSINC_TEvent_hpp
  47. // TEvent.hpp - end of file