/**
-@page overview_log wxLog Classes Overview
+@page overview_log Logging Overview
-Classes: wxLog, wxLogStderr, wxLogStream, wxLogTextCtrl, wxLogWindow, wxLogGui, wxLogNull, wxLogBuffer,
- wxLogChain, wxLogInterposer, wxLogInterposerTemp, wxStreamToTextRedirector, wxLogFormatter
-
-Table of contents:
-@li @ref overview_log_introduction
-@li @ref overview_log_enable
-@li @ref overview_log_targets
-@li @ref overview_log_mt
-@li @ref overview_log_customize
-@li @ref overview_log_tracemasks
-<hr>
-
-
-@section overview_log_introduction Introduction
+@tableofcontents
This is a general overview of logging classes provided by wxWidgets. The word
logging here has a broad sense, including all of the program output, not only
this function takes a trace mask as the first argument which allows to
further restrict the amount of messages generated.
+@see @ref group_funcmacro_log "Logging Functions and Macros"
+
The usage of these functions should be fairly straightforward, however it may
be asked why not use the other logging facilities, such as C standard stdio
functions or C++ streams. The short answer is that they're all very good
about data file writing error.
+
@section overview_log_enable Log Messages Selection
By default, most log messages are enabled. In particular, this means that
"MyProgram/DB" in the module working with the database and "MyProgram/DB/Trans"
in its part managing the transactions. Then you could use
wxLog::SetComponentLevel() in the following ways:
- @code
- // disable all database error messages, everybody knows databases never
- // fail anyhow
- wxLog::SetComponentLevel("MyProgram/DB", wxLOG_FatalError);
- // but enable tracing for the transactions as somehow our changes don't
- // get committed sometimes
- wxLog::SetComponentLevel("MyProgram/DB/Trans", wxLOG_Trace);
+@code
+// disable all database error messages, everybody knows databases never
+// fail anyhow
+wxLog::SetComponentLevel("MyProgram/DB", wxLOG_FatalError);
+
+// but enable tracing for the transactions as somehow our changes don't
+// get committed sometimes
+wxLog::SetComponentLevel("MyProgram/DB/Trans", wxLOG_Trace);
+
+// also enable tracing messages from wxWidgets dynamic module loading
+// mechanism
+wxLog::SetComponentLevel("wx/base/module", wxLOG_Trace);
+@endcode
- // also enable tracing messages from wxWidgets dynamic module loading
- // mechanism
- wxLog::SetComponentLevel("wx/base/module", wxLOG_Trace);
- @endcode
Notice that the log level set explicitly for the transactions code overrides
the log level of the parent component but that all other database code
subcomponents inherit its setting by default and so won't generate any log
messages at all.
+
+
@section overview_log_targets Log Targets
After having enumerated all the functions which are normally used to log the
which are called when a message is logged. Only one log target is @e active at
any moment, this is the one used by @ref group_funcmacro_log "wxLogXXX() functions".
The normal usage of a log object (i.e. object of a class derived from wxLog) is
-to install it as the active target with a call to @e SetActiveTarget() and it will be used
-automatically by all subsequent calls to @ref group_funcmacro_log "wxLogXXX() functions".
+to install it as the active target with a call to @e SetActiveTarget() and it
+will be used automatically by all subsequent calls to
+@ref group_funcmacro_log "wxLogXXX() functions".
To create a new log target class you only need to derive it from wxLog and
override one or several of wxLog::DoLogRecord(), wxLog::DoLogTextAtLevel() and
want to redirect the log messages and the destination doesn't depend on the
message log level.
-
There are some predefined classes deriving from wxLog and which might be
helpful to see how you can create a new log target class and, of course, may
also be used without any change. There are:
wxLogMessage("..."); // ok
@endcode
+@see @ref group_class_logging "Logging Classes"
+
The log targets can also be combined: for example you may wish to redirect the
messages somewhere else (for example, to a log file) but also process them as
normally. For this the wxLogChain, wxLogInterposer, and wxLogInterposerTemp can
be used.
+
@section overview_log_mt Logging in Multi-Threaded Applications
Starting with wxWidgets 2.9.1, logging functions can be safely called from any
other threads after a call to @c EnableLogging(false).
+
@section overview_log_customize Logging Customization
To completely change the logging behaviour you may define a custom log target.
customizing the dialog used by wxLogGui for the single messages.
-@section overview_log_tracemasks Using trace masks
+@section overview_log_tracemasks Using Trace Masks
Notice that the use of log trace masks is hardly necessary any longer in
current wxWidgets version as the same effect can be achieved by using
The standard trace masks are given in wxLogTrace() documentation.
*/
-