These functions provide a variety of logging functions: see Log classes overview for further information.
Include files
<wx/log.h>
::wxLogError
::wxLogFatalError
::wxLogWarning
::wxLogMessage
::wxLogVerbose
::wxLogStatus
::wxLogSysError
::wxLogDebug
::wxLogTrace
void wxLogError(const char* formatString, ...)
The function to use for error messages, i.e. the messages that must be shown to the user. The default processing is to pop up a message box to inform the user about it.
void wxLogFatalError(const char* formatString, ...)
Like wxLogError, but also terminates the program with the exit code 3. Using abort() standard function also terminates the program with this exit code.
void wxLogWarning(const char* formatString, ...)
For warnings - they are also normally shown to the user, but don't interrupt the program work.
void wxLogMessage(const char* formatString, ...)
for all normal, informational messages. They also appear in a message box by default (but it can be changed). Notice that the standard behaviour is to not show informational messages if there are any errors later - the logic being that the later error messages make the informational messages preceding them meaningless.
void wxLogVerbose(const char* formatString, ...)
For verbose output. Normally, it's suppressed, but might be activated if the user wishes to know more details about the program progress (another, but possibly confusing name for the same function is wxLogInfo).
void wxLogStatus(const char* formatString, ...)
For status messages - they will go into the status bar of the active or specified (as the first argument) wxFrame if it has one.
void wxLogSysError(const char* formatString, ...)
Mostly used by wxWindows itself, but might be handy for logging errors after system call (API function) failure. It logs the specified message text as well as the last system error code (errno or ::GetLastError() depending on the platform) and the corresponding error message. The second form of this function takes the error code explitly as the first argument.
void wxLogDebug(const char* formatString, ...)
The right function for debug output. It only does anything at all in the debug mode (when the preprocessor symbol __WXDEBUG__ is defined) and expands to nothing in release mode (otherwise).
void wxLogTrace(const char* formatString, ...)
void wxLogTrace(wxTraceMask mask, const char* formatString, ...)
As wxLogDebug, only does something in debug build. The reason for making it a separate function from it is that usually there are a lot of trace messages, so it might make sense to separate them from other debug messages which would be flooded in them. Moreover, the second version of this function takes a trace mask as the first argument which allows to further restrict the amount of messages generated. The value of mask can be: