1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/protocol/log.h
3 // Purpose: wxProtocolLog class for logging network exchanges
4 // Author: Troelsk, Vadim Zeitlin
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_PROTOCOL_LOG_H_
11 #define _WX_PROTOCOL_LOG_H_
13 #include "wx/string.h"
15 // ----------------------------------------------------------------------------
16 // wxProtocolLog: simple class for logging network requests and responses
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_NET wxProtocolLog
22 // Create object doing the logging using wxLogTrace() with the specified
24 wxProtocolLog(const wxString
& traceMask
)
25 : m_traceMask(traceMask
)
29 // Virtual dtor for the base class
30 virtual ~wxProtocolLog() { }
32 // Called by wxProtocol-derived classes to actually log something
33 virtual void LogRequest(const wxString
& str
)
35 DoLogString("==> " + str
);
38 virtual void LogResponse(const wxString
& str
)
40 DoLogString("<== " + str
);
44 // Can be overridden by the derived classes.
45 virtual void DoLogString(const wxString
& str
);
48 const wxString m_traceMask
;
50 wxDECLARE_NO_COPY_CLASS(wxProtocolLog
);
53 #endif // _WX_PROTOCOL_LOG_H_