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.

79 lines
2.4 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. MPC_logging.h
  5. Abstract:
  6. This file contains the declaration of a set of logging classes.
  7. Revision History:
  8. Davide Massarenti (Dmassare) 05/09/99
  9. created
  10. ******************************************************************************/
  11. #if !defined(__INCLUDED___MPC___LOGGING_H___)
  12. #define __INCLUDED___MPC___LOGGING_H___
  13. #include <MPC_main.h>
  14. #include <MPC_COM.h>
  15. namespace MPC
  16. {
  17. class FileLog : public MPC::CComSafeAutoCriticalSection // Hungarian: fl
  18. {
  19. MPC::wstring m_szLogFile;
  20. HANDLE m_hFile;
  21. bool m_fCacheHandle;
  22. bool m_fUseUnicode;
  23. HRESULT Open ();
  24. HRESULT Close();
  25. HRESULT AppendString( /*[in]*/ LPCWSTR szLine );
  26. HRESULT WriteEntry ( /*[in]*/ LPWSTR szLine );
  27. public:
  28. FileLog( /*[in]*/ bool fCacheHandle = true, /*[in]*/ bool fUseUnicode = false );
  29. FileLog( /*[in]*/ const FileLog& fl );
  30. ~FileLog();
  31. FileLog& operator=( /*[in]*/ const FileLog& fl );
  32. HRESULT SetLocation( /*[in]*/ LPCWSTR szLogFile );
  33. HRESULT Rotate ( /*[in]*/ DWORD dwDays = 0 );
  34. HRESULT Terminate ( );
  35. HRESULT LogRecordV( /*[in]*/ LPCWSTR szFormat, /*[in]*/ va_list arglist );
  36. HRESULT LogRecordV( /*[in]*/ LPCSTR szFormat, /*[in]*/ va_list arglist );
  37. HRESULT LogRecord ( /*[in]*/ LPCWSTR szFormat, ... );
  38. HRESULT LogRecord ( /*[in]*/ LPCSTR szFormat, ... );
  39. };
  40. class NTEvent : public MPC::CComSafeAutoCriticalSection // Hungarian: ne
  41. {
  42. HANDLE m_hEventSource;
  43. HRESULT OpenFile ();
  44. HRESULT CloseFile();
  45. public:
  46. NTEvent( );
  47. NTEvent( /*[in]*/ const NTEvent& ne );
  48. ~NTEvent();
  49. NTEvent& operator=( /*[in]*/ const NTEvent& ne );
  50. HRESULT Init ( /*[in]*/ LPCWSTR szEventSourceName );
  51. HRESULT Terminate( );
  52. HRESULT LogEvent( /*[in]*/ WORD wEventType, /*[in]*/ DWORD dwEventID, ... );
  53. };
  54. };
  55. #endif // !defined(__INCLUDED___MPC___LOGGING_H___)