-
- @section log_derivingyours Deriving your own log target
-
- There are several methods which may be overridden in the derived class to
- customize log messages handling: DoLogRecord(), DoLogTextAtLevel() and
- DoLogText().
-
- The last method is the simplest one: you should override it if you simply
- want to redirect the log output elsewhere, without taking into account the
- level of the message. If you do want to handle messages of different levels
- differently, then you should override DoLogTextAtLevel().
-
- Finally, if more control over the output format is needed, then the first
- function must be overridden as it allows to construct custom messages
- depending on the log level or even do completely different things depending
- on the message severity (for example, throw away all messages except
- warnings and errors, show warnings on the screen and forward the error
- messages to the user's (or programmer's) cell phone -- maybe depending on
- whether the timestamp tells us if it is day or night in the current time
- zone).
-
- There also functions to support message buffering. Why are they needed?
- Some of wxLog implementations, most notably the standard wxLogGui class,
- buffer the messages (for example, to avoid showing the user a zillion of modal
- message boxes one after another -- which would be really annoying).
-
- Flush() shows them all and clears the buffer contents.
- This function doesn't do anything if the buffer is already empty.
-
- @see FlushActive()
-
-
- @section log_tracemasks Using trace masks
-
- The functions below allow some limited customization of wxLog behaviour
- without writing a new log target class (which, aside from being a matter of
- several minutes, allows you to do anything you want).
- The verbose messages are the trace messages which are not disabled in the
- release mode and are generated by wxLogVerbose().
- They are not normally shown to the user because they present little interest,
- but may be activated, for example, in order to help the user find some program
- problem.
-
- As for the (real) trace messages, their handling depends on the currently
- enabled trace masks: if AddTraceMask() was called for the mask of the given
- message, it will be logged, otherwise nothing happens.
-
- For example,
- @code
- wxLogTrace( wxTRACE_OleCalls, "IFoo::Bar() called" );
- @endcode
-
- will log the message if it was preceded by:
-
- @code
- wxLog::AddTraceMask( wxTRACE_OleCalls);
- @endcode
-
- The standard trace masks are given in wxLogTrace() documentation.
-
- Finally, the @e wxLog::DoLog() function automatically prepends a time stamp
- to all the messages. The format of the time stamp may be changed: it can be
- any string with % specifications fully described in the documentation of the
- standard @e strftime() function. For example, the default format is
- "[%d/%b/%y %H:%M:%S] " which gives something like "[17/Sep/98 22:10:16] "
- (without quotes) for the current date. Setting an empty string as the time
- format or calling the shortcut wxLog::DisableTimestamp(), disables timestamping
- of the messages completely.
-
- See also
- @li AddTraceMask()
- @li RemoveTraceMask()
- @li ClearTraceMasks()
- @li GetTraceMasks()
- @li IsAllowedTraceMask()
- @li SetVerbose()
- @li GetVerbose()
- @li SetTimestamp()
- @li GetTimestamp()
- @li SetTraceMask()
- @li GetTraceMask()
- @li SetRepetitionCounting()
- @li GetRepetitionCounting()
-
- @note
- Timestamping is disabled for Visual C++ users in debug builds by
- default because otherwise it would be impossible to directly go to the line
- from which the log message was generated by simply clicking in the debugger
- window on the corresponding error message. If you wish to enable it, please
- use SetTimestamp() explicitly.
-
-
- @section log_target Manipulating the log target
-
- The functions in this section work with and manipulate the active log
- target.
-
- Get/Set methods are used to install/query the current active target and,
- finally, DontCreateOnDemand() disables the automatic creation of a standard
- log target if none actually exists. It is only useful when the application
- is terminating and shouldn't be used in other situations because it may
- easily lead to a loss of messages.
-
- See also:
- @li GetActiveTarget()
- @li SetActiveTarget()
- @li DontCreateOnDemand()
- @li Suspend()
- @li Resume()
-
-