ApiLog.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // FileZilla - a Windows ftp client
  2. // Copyright (C) 2002-2004 - Tim Kosse <[email protected]>
  3. // This program is free software; you can redistribute it and/or
  4. // modify it under the terms of the GNU General Public License
  5. // as published by the Free Software Foundation; either version 2
  6. // of the License, or (at your option) any later version.
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU General Public License for more details.
  11. // You should have received a copy of the GNU General Public License
  12. // along with this program; if not, write to the Free Software
  13. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. // ApiLog.h: Schnittstelle für die Klasse CApiLog.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #if !defined(AFX_APILOG_H__D9CD5BA6_3B94_4BF4_BF59_BD20CEB61811__INCLUDED_)
  18. #define AFX_APILOG_H__D9CD5BA6_3B94_4BF4_BF59_BD20CEB61811__INCLUDED_
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif // _MSC_VER > 1000
  22. class CApiLog
  23. {
  24. public:
  25. CApiLog();
  26. virtual ~CApiLog();
  27. BOOL InitLog(HWND hTargerWnd, int nLogMessage);
  28. BOOL InitLog(CApiLog *pParent);
  29. bool LoggingMessageType(int nMessageType) const;
  30. void LogMessage(int nMessageType, LPCTSTR pMsgFormat, ...) const;
  31. void LogMessageRaw(int nMessageType, LPCTSTR pMsg) const;
  32. void LogMessage(int nMessageType, UINT nFormatID, ...) const;
  33. void LogMessage(CString SourceFile, int nSourceLine, void *pInstance, int nMessageType, LPCTSTR pMsgFormat, ...) const;
  34. void LogMessageRaw(CString SourceFile, int nSourceLine, void *pInstance, int nMessageType, LPCTSTR pMsg) const;
  35. BOOL SetDebugLevel(int nLogLevel);
  36. protected:
  37. #ifdef MPEXT
  38. virtual BOOL PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) const;
  39. #endif
  40. void SendLogMessage(int nMessageType, LPCTSTR pMsg) const;
  41. int m_nDebugLevel;
  42. CApiLog *m_pApiLogParent; //Pointer to topmost parent
  43. int m_nLogMessage;
  44. HWND m_hTargetWnd;
  45. };
  46. #endif // !defined(AFX_APILOG_H__D9CD5BA6_3B94_4BF4_BF59_BD20CEB61811__INCLUDED_)