1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
<HTML>
<head><title>Log functions</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="logfunctions"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx264.htm#functions"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx273.htm#resourcefuncs"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx275.htm#debugmacros"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>Log functions</H2>
<P>
These functions provide a variety of logging functions: see <A HREF="wx282.htm#wxlogoverview">Log classes overview</A> for
further information.<P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/log.h><P>
<A HREF="#wxlogerror">::wxLogError</A><BR>
<A HREF="#wxlogfatalerror">::wxLogFatalError</A><BR>
<A HREF="#wxlogwarning">::wxLogWarning</A><BR>
<A HREF="#wxlogmessage">::wxLogMessage</A><BR>
<A HREF="#wxlogverbose">::wxLogVerbose</A><BR>
<A HREF="#wxlogstatus">::wxLogStatus</A><BR>
<A HREF="#wxlogsyserror">::wxLogSysError</A><BR>
<A HREF="#wxlogdebug">::wxLogDebug</A><BR>
<A HREF="#wxlogtrace">::wxLogTrace</A><BR>
<P>
<HR>
<A NAME="wxlogerror"></A>
<H3>::wxLogError</H3>
<P>
<B>void</B> <B>wxLogError</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
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.<P>
<HR>
<A NAME="wxlogfatalerror"></A>
<H3>::wxLogFatalError</H3>
<P>
<B>void</B> <B>wxLogFatalError</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
Like <A HREF="wx274.htm#wxlogerror">wxLogError</A>, but also
terminates the program with the exit code 3. Using <I>abort()</I> standard
function also terminates the program with this exit code.<P>
<HR>
<A NAME="wxlogwarning"></A>
<H3>::wxLogWarning</H3>
<P>
<B>void</B> <B>wxLogWarning</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
For warnings - they are also normally shown to the
user, but don't interrupt the program work.<P>
<HR>
<A NAME="wxlogmessage"></A>
<H3>::wxLogMessage</H3>
<P>
<B>void</B> <B>wxLogMessage</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
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.<P>
<HR>
<A NAME="wxlogverbose"></A>
<H3>::wxLogVerbose</H3>
<P>
<B>void</B> <B>wxLogVerbose</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
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 <B>wxLogInfo</B>).<P>
<HR>
<A NAME="wxlogstatus"></A>
<H3>::wxLogStatus</H3>
<P>
<B>void</B> <B>wxLogStatus</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
For status messages - they will go into the status
bar of the active or specified (as the first argument) <A HREF="wx104.htm#wxframe">wxFrame</A> if it has one.<P>
<HR>
<A NAME="wxlogsyserror"></A>
<H3>::wxLogSysError</H3>
<P>
<B>void</B> <B>wxLogSysError</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
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 (<I>errno</I> or <I>::GetLastError()</I> depending
on the platform) and the corresponding error
message. The second form of this function takes the error code explitly as the
first argument.<P>
<HR>
<A NAME="wxlogdebug"></A>
<H3>::wxLogDebug</H3>
<P>
<B>void</B> <B>wxLogDebug</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
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).<P>
<HR>
<A NAME="wxlogtrace"></A>
<H3>::wxLogTrace</H3>
<P>
<B>void</B> <B>wxLogTrace</B>(<B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
<B>void</B> <B>wxLogTrace</B>(<B>wxTraceMask</B><I> mask</I>, <B>const char*</B><I> formatString</I>, <B>...</B><I></I>)<P>
As <B>wxLogDebug</B>, 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 <I>mask</I> can be:<P>
<UL>
<LI> wxTraceMemAlloc: trace memory allocation (new/delete)
<LI> wxTraceMessages: trace window messages/X callbacks
<LI> wxTraceResAlloc: trace GDI resource allocation
<LI> wxTraceRefCount: trace various ref counting operations
</UL>
<P>
</BODY></HTML>
|