Finished adding @tableofcontents to all overviews in the manual.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,22 +8,9 @@
|
||||
|
||||
/**
|
||||
|
||||
@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
|
||||
@@ -75,6 +62,8 @@ of arguments or a variable argument list pointer. Here are all of them:
|
||||
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
|
||||
@@ -111,6 +100,7 @@ classes are. Some of advantages in using wxWidgets log functions are:
|
||||
about data file writing error.
|
||||
|
||||
|
||||
|
||||
@section overview_log_enable Log Messages Selection
|
||||
|
||||
By default, most log messages are enabled. In particular, this means that
|
||||
@@ -141,24 +131,28 @@ you could give it the value "MyProgram" by default and re-define it as
|
||||
"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
|
||||
@@ -170,8 +164,9 @@ from wxLog. As such, it implements the virtual functions of the base class
|
||||
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
|
||||
@@ -184,7 +179,6 @@ formatting. Finally, it is enough to override wxLog::DoLogText() if you only
|
||||
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:
|
||||
@@ -222,12 +216,15 @@ 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
|
||||
@@ -247,6 +244,7 @@ affect the current thread, i.e. logging messages may still be generated by the
|
||||
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.
|
||||
@@ -294,7 +292,7 @@ The @e dialog sample illustrates this approach by defining 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
|
||||
@@ -328,4 +326,3 @@ wxLog::AddTraceMask( wxTRACE_OleCalls );
|
||||
The standard trace masks are given in wxLogTrace() documentation.
|
||||
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user