.\" This is a wxWidgets manpage page generated from the XML docs .TH wxLog 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxLog \- The base log class .SH DESCRIPTION wxLog class defines the interface for the log targets used by wxWidgets logging functions as explained in the wxLog overview . The only situations when you need to directly use this class is when you want to derive your own log target because the existing ones don't satisfy your needs. Another case is if you wish to customize the behaviour of the standard logging classes (all of which respect the wxLog settings): for example, set which trace messages are logged and which are not or change (or even remove completely) the timestamp on the messages. Otherwise, it is completely hidden behind the wxLogXXX() functions and you may not even know about its existence. See log overview for the descriptions of wxWidgets logging facilities. .SH "PARENTS" .SH "INCLUDE FILES" wx/log.h .SH MEMBERS .SS static void AddTraceMask (const wxString& mask) Add the mask to the list of allowed masks for wxLogTrace . .SS static void ClearTraceMasks () Removes all trace masks previously set with AddTraceMask . .SS static const wxArrayString & GetTraceMasks () Returns the currently allowed list of string trace masks. .SS static void OnLog (wxLogLevel levelconst char * message) Forwards the message at specified level to the DoLog() function of the active log target if there is any, does nothing otherwise. .SS static wxLog * GetActiveTarget () Returns the pointer to the active log target (may be NULL). .SS static wxLog * SetActiveTarget (wxLog * logtarget) Sets the specified log target as the active one. Returns the pointer to the previous active log target (may be NULL). To supress logging use a new instance of wxLogNull not NULL. If the active log target is set to NULL a new default log target will be created when logging occurs. .SS static void Suspend () Suspends the logging until Resume is called. Note that the latter must be called the same number of times as the former to undo it, i.e. if you call Suspend() twice you must call Resume() twice as well. Note that suspending the logging means that the log sink won't be be flushed periodically, it doesn't have any effect if the current log target does the logging immediately without waiting for Flush to be called (the standard GUI log target only shows the log dialog when it is flushed, so Suspend() works as expected with it). .SS static void Resume () Resumes logging previously suspended by a call to Suspend . All messages logged in the meanwhile will be flushed soon. .SS virtual void DoLog (wxLogLevel levelconst wxChar *msgtime_t timestamp) Called to process the message of the specified severity. msg is the text of the message as specified in the call of wxLogXXX() function which generated it and timestamp is the moment when the message was generated. The base class version prepends the timestamp to the message, adds a prefix corresponding to the log level and then calls DoLogString with the resulting string. .SS virtual void DoLogString (const wxChar *msgtime_t timestamp) Called to log the specified string. The timestamp is already included into the string but still passed to this function. A simple implementation may just send the string to stdout or, better, stderr . .SS static void DontCreateOnDemand () Instructs wxLog to not create new log targets on the fly if there is none currently. (Almost) for internal use only: it is supposed to be called by the application shutdown code. Note that this function also calls ClearTraceMasks . .SS virtual void Flush () Shows all the messages currently in buffer and clears it. If the buffer is already empty, nothing happens. .SS static void FlushActive () Flushes the current log target if any, does nothing if there is none. .SS static void SetVerbose (bool verbose = true) Activates or deactivates verbose mode in which the verbose messages are logged as the normal ones instead of being silently dropped. .SS static bool GetVerbose () Returns whether the verbose mode is currently active. .SS static void SetLogLevel (wxLogLevel logLevel) Specifies that log messages with level > logLevel should be ignored and not sent to the active log target. .SS static wxLogLevel GetLogLevel () Returns the current log level limit. .SS void SetTimestamp (const char * format) Sets the timestamp format prepended by the default log targets to all messages. The string may contain any normal characters as well as % prefixed format specificators, see strftime() manual for details. Passing a NULL value (not empty string) to this function disables message timestamping. .SS const char * GetTimestamp () Returns the current timestamp format string. .SS static void SetTraceMask (wxTraceMask mask) Sets the trace mask, see Customization section for details. .SS static bool IsAllowedTraceMask (const wxChar *mask) Returns true if the mask is one of allowed masks for wxLogTrace . See also AddTraceMask , RemoveTraceMask .SS static void RemoveTraceMask (const wxString& mask) Remove the mask from the list of allowed masks for wxLogTrace . See also AddTraceMask .SH "SEE ALSO" .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.