|
Boost-Commit : |
From: john.groups_at_[hidden]
Date: 2007-11-15 17:53:53
Author: jtorjo
Date: 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
New Revision: 41122
URL: http://svn.boost.org/trac/boost/changeset/41122
Log:
[logging]
v0.11.14, 15 nov 2007
- updated docs - added page showing how to declare/define your logger/filter classes
- updated macros documentation (still to do)
Added:
sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp (contents, props changed)
Text files modified:
sandbox/logging/boost/logging/detail/filter.hpp | 24 +
sandbox/logging/boost/logging/detail/level.hpp | 1
sandbox/logging/boost/logging/detail/macros.hpp | 366 +++++++++++++++++++++++++++++++++++++--
sandbox/logging/boost/logging/detail/raw_doc/changelog.hpp | 4
sandbox/logging/boost/logging/detail/raw_doc/table_of_contents.hpp | 10
sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp | 1
sandbox/logging/boost/logging/format.hpp | 20 +
sandbox/logging/lib/logging/internal/vc8/loggingvc8/loggingvc8.vcproj | 10
8 files changed, 386 insertions(+), 50 deletions(-)
Modified: sandbox/logging/boost/logging/detail/filter.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/filter.hpp (original)
+++ sandbox/logging/boost/logging/detail/filter.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -74,14 +74,14 @@
- filter::always_disabled
- filter::debug_enabled
- filter::release_enabled
- - filter_level (when you use levels)
+ - in case you use levels, see level namespace
*/
namespace filter {
/**
- Manages is_enabled/set_enabled in a non-thread-safe way (usually, this is the default filter - unless you override it).
+ @brief Manages is_enabled/set_enabled in a non-thread-safe way.
If you change set_enabled() while program is running, it can take a bit to propagate
between threads. Most of the time, this should be acceptable.
@@ -96,7 +96,7 @@
/**
- Filter that is always enabled
+ @brief Filter that is always enabled
*/
struct always_enabled {
static bool is_enabled() { return true; }
@@ -104,7 +104,7 @@
/**
- Filter that is always disabled
+ @brief Filter that is always disabled
*/
struct always_disabled {
static bool is_enabled() { return false; }
@@ -112,7 +112,7 @@
/**
- Filter that is enabled in debug mode
+ @brief Filter that is enabled in debug mode
*/
struct debug_enabled {
#ifndef NDEBUG
@@ -124,7 +124,7 @@
/**
- Filter that is enabled in release mode
+ @brief Filter that is enabled in release mode
*/
struct release_enabled {
#ifdef NDEBUG
@@ -136,7 +136,8 @@
/**
- Thread-safe filter. Manages is_enabled/set_enabled in a thread-safe way.
+ @brief Thread-safe filter. Manages is_enabled/set_enabled in a thread-safe way.
+
However, it manages it rather ineffiently - always locking before asking.
*/
struct ts {
@@ -160,7 +161,9 @@
#ifndef BOOST_LOG_NO_TSS
/**
- Uses TSS (Thread Specific Storage) to find out if a filter is enabled or not. It caches the current "is_enabled" on each thread.
+ @brief Uses TSS (Thread Specific Storage) to find out if a filter is enabled or not.
+
+ It caches the current "is_enabled" on each thread.
Then, at a given period, it retrieves the real "is_enabled".
@remarks
@@ -184,7 +187,10 @@
data m_enabled;
};
-
+/**
+ @brief Uses TSS (Thread Specific Storage) to find out if a filter is enabled or not. Once the filter is initialized to a value, that value will always be used.
+
+*/
struct use_tss_once_init {
typedef locker::tss_resource_once_init<bool> data;
Modified: sandbox/logging/boost/logging/detail/level.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/level.hpp (original)
+++ sandbox/logging/boost/logging/detail/level.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -43,7 +43,6 @@
If warning level is enabled, all messages are logged, but the warnings.
If debug level is enabled, messages that have levels debug, error, fatal will be logged.
- @sa filter_level
*/
namespace level {
/** the higher the level , the more critical the error */
Modified: sandbox/logging/boost/logging/detail/macros.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/macros.hpp (original)
+++ sandbox/logging/boost/logging/detail/macros.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -32,39 +32,359 @@
namespace boost { namespace logging {
/**
- @page macros Macros - how, what for?
+@page macros Macros - how, what for?
- The need for macros - creating the object before main.
+- @ref macros_if_else_strategy
+- @ref macros_using
+ - @ref macros_define_declare
+ - @ref BOOST_DECLARE_LOG
+ - @ref BOOST_DEFINE_LOG
+ - @ref BOOST_DEFINE_LOG_WITH_ARGS
+ - @ref BOOST_DECLARE_LOG_FILTER
+ - @ref BOOST_DEFINE_LOG_FILTER
+ - @ref BOOST_DEFINE_LOG_FILTER_WITH_ARGS
+ - @ref macros_use
+ - @ref BOOST_LOG_USE_LOG
+ - @ref BOOST_LOG_USE_LOG_IF_LEVEL
+ - @ref BOOST_LOG_USE_LOG_IF_FILTER
+ - @ref BOOST_LOG_USE_SIMPLE_LOG_IF_FILTER
+ - @ref macros_set_formatters
+ - @ref BOOST_LOG_FORMAT_MSG
+ - @ref BOOST_LOG_DESTINATION_MSG
+ - @ref macros_use_tags
+ - @ref BOOST_LOG_TAG
+ - @ref BOOST_LOG_TAG_LEVEL
+ - @ref BOOST_LOG_TAG_FILELINE
+ - @ref BOOST_LOG_TAG_FUNCTION
+ - @ref macros_compile_time
+ - @ref BOOST_LOG_COMPILE_FAST_ON
+ - @ref BOOST_LOG_COMPILE_FAST_OFF
+ - @ref BOOST_LOG_COMPILE_FAST
+ - @ref macros_tss
+ - @ref BOOST_LOG_TSS_USE_INTERNAL
+ - @ref BOOST_LOG_TSS_USE_BOOST
+ - @ref BOOST_LOG_TSS_USE_CUSTOM
+ - @ref BOOST_LOG_NO_TSS
- When dealing with logs, you will most likely want to use macros: simply to write less.
- To be efficient, you usually want to write to a log only if it's enabled.
- Either you always write: <tt> if ( g_log) g_log .... </tt>, or, you create macros:
-
- @code
- #define L_ if ( g_log) g_log ....
- @endcode
- FIXME to be continued :) explain about the fact that you can create your own macros, depending on what *you* want
- Explain why the if ; else strategy: so that if withing if (x) LOG_ ... ; else blabla - still ok
- #define L_ if ( g_single_log) ; else g_single_log->read_msg().gather().msg()
- don't want compile fast? then log.h will look easier; but - are you sure you don't want to turn compile fast off?
- @section macros_gathering
- FIXME
+Simply put, you need to use macros to make sure objects (logger(s) and filter(s)) :
+- are created before main
+- are always created before being used
- Macros
- - BOOST_LOG_COMPILE_FAST_ON
- - BOOST_LOG_COMPILE_FAST_OFF
- - BOOST_LOG_COMPILE_FAST
+The problem we want to avoid is using a logger object before it's initialized - this could happen
+if logging from the constructor of a global/static object.
-BOOST_LOG_TSS_USE_INTERNAL
-BOOST_LOG_TSS_USE_BOOST
-BOOST_LOG_TSS_USE_CUSTOM
-BOOST_LOG_NO_TSS
+Using macros makes sure logging happens efficiently. Basically what you want to achieve is something similar to:
+
+@code
+if ( is_filter_enabled)
+ logger.gather_the_message_and_log_it();
+@endcode
+
+
+
+@section macros_if_else_strategy The if-else strategy
+
+When gathering the message, what the macros will achieve is this:
+
+@code
+#define YOUR_COOL_MACRO_GOOD if ( !is_filter_enabled) ; else logger.gather_the_message_and_log_it();
+@endcode
+
+The above is the correct way, instead of
+
+@code
+#define YOUR_COOL_MACRO_BAD if ( is_filter_enabled) logger.gather_the_message_and_log_it();
+@endcode
+
+because of
+
+@code
+if ( some_test)
+ YOUR_COOL_MACRO_BAD << "some message ";
+else
+ whatever();
+@endcode
+
+In this case, @c whatever() will be called if @c some_test is true, and if @c is_filter_enabled is false.
+
+\n\n
+
+@section macros_using Using the macros supplied with the library
+
+There are several types of macros that this library supplies. They're explained below:
+
+@subsection macros_define_declare Macros to declare/define logs/filters
+
+@subsubsection BOOST_DECLARE_LOG BOOST_DECLARE_LOG - declaring a log
+
+@code
+BOOST_DECLARE_LOG(log_name, log_type)
+@endcode
+
+This declares a log. It should be used in a header file, to declare the log.
+Note that @c log_type only needs to be a declaration (a @c typedef, for instance)
+
+Example:
+@code
+typedef logger_format_write< > log_type;
+BOOST_DECLARE_LOG(g_l, log_type)
+@endcode
+
+
+@subsubsection BOOST_DEFINE_LOG BOOST_DEFINE_LOG - defining a log
+
+@code
+BOOST_DEFINE_LOG(log_name, log_type)
+@endcode
+
+This defines a log. It should be used in a source file, to define the log.
+
+Example:
+@code
+typedef logger_format_write< > log_type;
+...
+BOOST_DEFINE_LOG(g_l, log_type)
+@endcode
+
+
+@subsubsection BOOST_DEFINE_LOG_WITH_ARGS BOOST_DEFINE_LOG_WITH_ARGS - defining a log with arguments
+
+@code
+BOOST_DEFINE_LOG_WITH_ARGS (log_name, log_type, args)
+@endcode
+
+This defines a log - and specifies some arguments to be used at its constructed. It should be used in a source file, to define the log.
+
+Example:
+@code
+typedef logger< default_, destination::file> err_log_type;
+...
+BOOST_DEFINE_LOG_WITH_ARGS( g_log_err, err_log_type, ("err.txt") )
+@endcode
+
+
+@subsubsection BOOST_DECLARE_LOG_FILTER BOOST_DECLARE_LOG_FILTER - declaring a log filter
+
+@code
+BOOST_DECLARE_LOG_FILTER(filter_name, filter_type)
+@endcode
+
+This declares a log filter. It should be used in a header file, to declare the log filter.
+
+Example:
+@code
+BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
+@endcode
+
+
+@subsubsection BOOST_DEFINE_LOG_FILTER BOOST_DEFINE_LOG_FILTER - defining a log filter
+
+@code
+BOOST_DEFINE_LOG_FILTER(filter_name, filter_type)
+@endcode
+
+This defines a log filter. It should be used in a source file, to define the log filter.
+
+Example:
+@code
+BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
+@endcode
+
+
+
+@subsubsection BOOST_DEFINE_LOG_FILTER_WITH_ARGS BOOST_DEFINE_LOG_FILTER_WITH_ARGS - defining a log filter with args
+
+
+@code
+BOOST_DEFINE_LOG_FILTER_WITH_ARGS(filter_name, filter_type, args)
+@endcode
+
+This defines a log filter - and specifies some arguments to be used at its constructed. It should be used in a source file, to define the log filter.
+
+Example:
+@code
+#define L_ BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
+@endcode
+
+
+
+@subsection macros_use Defining your own macros for logging
+
+@subsubsection BOOST_LOG_USE_LOG_IF_LEVEL BOOST_LOG_USE_LOG_IF_LEVEL
+
+Uses a logger if a filter has a certain level enabled:
+
+@code
+BOOST_LOG_USE_LOG_IF_LEVEL(log, level_filter, level )
+@endcode
+
+Example:
+@code
+BOOST_DECLARE_LOG_FILTER(g_log_level, boost::logging::level::holder )
+BOOST_DECLARE_LOG(g_log_err, log_type)
+
+#define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err, g_log_level, error )
+@endcode
+
+@subsubsection BOOST_LOG_USE_LOG_IF_FILTER BOOST_LOG_USE_LOG_IF_FILTER
+
+Uses a logger if a filter is enabled:
+
+@code
+BOOST_LOG_USE_LOG_IF_FILTER(log, filter_is_enabled)
+@endcode
+
+Example:
+@code
+#define LERR_ BOOST_LOG_USE_LOG_IF_FILTER(g_log_err, g_log_filter->is_enabled() )
+@endcode
+
+
+@subsubsection BOOST_LOG_USE_LOG BOOST_LOG_USE_LOG
+
+Uses a logger:
+
+@code
+BOOST_LOG_USE_LOG(l, do_func, is_log_enabled)
+@endcode
+
+Normally you don't use this directly. You use @ref BOOST_LOG_USE_LOG_IF_FILTER or @ref BOOST_LOG_USE_LOG_IF_LEVEL instead.
+
+
+@subsubsection BOOST_LOG_USE_SIMPLE_LOG_IF_FILTER BOOST_LOG_USE_SIMPLE_LOG_IF_FILTER
+
+Uses a simple logger:
+
+@code
+BOOST_LOG_USE_SIMPLE_LOG_IF_FILTER(l, is_log_enabled)
+@endcode
+
+A simple logger is one that uses a simple gather class (FIXME). Example:
+
+@code
+struct no_gather {
+ const char * m_msg;
+ no_gather() : m_msg(0) {}
+ const char * msg() const { return m_msg; }
+ void out(const char* msg) { m_msg = msg; }
+ void out(const std::string& msg) { m_msg = msg.c_str(); }
+};
+
+typedef logger< no_gather, destination::cout > app_log_type;
+
+#define LAPP_ BOOST_LOG_USE_SIMPLE_LOG_IF_FILTER(g_log_app, g_log_filter->is_enabled() )
+@endcode
+
+
+@subsection macros_set_formatters Setting formatter/destination strings
+
+@subsubsection BOOST_LOG_FORMAT_MSG BOOST_LOG_FORMAT_MSG
+
+Sets the string class used by the formatter classes. By default, it's <tt>std::(w)string</tt>
+
+@code
+BOOST_LOG_FORMAT_MSG( string_class )
+@endcode
+
+You can do this to optimize formatting the message - that is, use a string class optimized for appending and prepending messages
+(which is basically what formatting is all about).
+
+Example:
+@code
+BOOST_LOG_FORMAT_MSG( optimize::cache_string_one_str<> )
+@endcode
+
+
+@subsubsection BOOST_LOG_DESTINATION_MSG BOOST_LOG_DESTINATION_MSG
+
+Sets the string class used by the destination classes. By default, it's <tt>std::(w)string</tt>
+
+@code
+BOOST_LOG_DESTINATION_MSG( string_class )
+@endcode
+
+Example:
+@code
+BOOST_LOG_DESTINATION_MSG( std::string )
+@endcode
+
+Usually you won't need to change this. The destination classes don't change the contets of the string - each class just writes the string
+to a given destination.
+
+
+
+
+
+
+
+@subsection macros_use_tags Using tags
+
+@subsubsection BOOST_LOG_TAG BOOST_LOG_TAG
+
+@code
+BOOST_LOG_TAG(tag_class)
+@endcode
+
+@subsubsection BOOST_LOG_TAG_LEVEL BOOST_LOG_TAG_LEVEL
+
+@code
+BOOST_LOG_TAG(tag_level)
+@endcode
+
+@subsubsection BOOST_LOG_TAG_FILELINE BOOST_LOG_TAG_FILELINE
+
+@code
+BOOST_LOG_TAG_FILELINE
+@endcode
+
+@subsubsection BOOST_LOG_TAG_FUNCTION BOOST_LOG_TAG_FUNCTION
+
+@code
+BOOST_LOG_TAG_FUNCTION
+@endcode
+
+
+@subsection macros_compile_time Macros that treat compilation time
+
+@subsubsection BOOST_LOG_COMPILE_FAST_ON BOOST_LOG_COMPILE_FAST_ON
+
+If you define this, it turns fast compilation on (this is the default anyway).
+FIXME
+
+@subsubsection BOOST_LOG_COMPILE_FAST_OFF BOOST_LOG_COMPILE_FAST_OFF
+
+If you define this, it turns fast compilation off
+
+@subsubsection BOOST_LOG_COMPILE_FAST BOOST_LOG_COMPILE_FAST
+
+If defined, it means we're doing fast-compile. Otherwise, we're not doing fast compile.
+Don't define this! It's defined automatically.
+
+
+
+@subsection macros_tss Macros that deal with Thread Specific Storage
+
+@subsubsection BOOST_LOG_TSS_USE_INTERNAL BOOST_LOG_TSS_USE_INTERNAL
+
+If defined...
+
+@subsubsection BOOST_LOG_TSS_USE_BOOST BOOST_LOG_TSS_USE_BOOST
+
+If defined...
+
+@subsubsection BOOST_LOG_TSS_USE_CUSTOM BOOST_LOG_TSS_USE_CUSTOM
+
+If defined...
+
+@subsubsection BOOST_LOG_NO_TSS BOOST_LOG_NO_TSS
+
+If defined...
*/
Modified: sandbox/logging/boost/logging/detail/raw_doc/changelog.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/changelog.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/changelog.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -1,7 +1,9 @@
/**
@page page_changelog Changelog
-_at_section changelog_cur_ver Current Version: v0.11.13, 15 nov 2007
+@section changelog_cur_ver Current Version: v0.11.14, 15 nov 2007
+- updated docs
+- updated macros documentation (still to do)
- added @ref starter_project
- solved bug when using append_newline_if_needed() - when not used with string
- solved bug at opening file for initial overwrite
Added: sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp
==============================================================================
--- (empty file)
+++ sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -0,0 +1,139 @@
+namespace boost { namespace logging {
+
+/**
+@page defining_your_logger_filter Declaring/Defining your logger/filter class(es)
+
+When using the Boost Logging Lib, you need 2 things (see @ref workflow "Workflow"):
+- a filter : which tells you if a logger is enabled or not. Note that you can use the same filter for multiple loggers - if you want.
+- a logger : which does the actual logging, once the filter is enabled
+
+
+- @ref defining_your_filter
+ - @ref defining_your_filter_scenario
+ - @ref defining_your_filter_manually
+- @ref defining_your_logger
+ - @ref defining_your_logger_scenario
+ - @ref defining_your_logger_format_write
+ - @ref defining_your_logger_use_logger
+
+
+
+
+
+@section defining_your_filter Declaring/Defining your filter class
+
+@subsection defining_your_filter_scenario Declare/Define your filter using scenarios (the easy way)
+
+You can declare/define both your logger and filter based on how you'll use them (scenario::usage).
+Thus, you'll deal with the filter like this:
+
+@code
+#include <boost/logging/format_fwd.hpp>
+using namespace boost::logging::scenario::usage;
+typedef use<
+ // how often does the filter change?
+ filter_::change::often<10>,
+ // does the filter use levels?
+ filter_::level::no_levels,
+ // logger info
+ ...
+ > finder;
+
+// declare filter
+BOOST_DECLARE_LOG_FILTER(g_log_filter, finder::filter )
+
+// define filter
+BOOST_DEFINE_LOG_FILTER(g_log_filter, finder::filter )
+@endcode
+
+
+@subsection defining_your_filter_manually Declare/Define your filter manually
+
+This is where you manually specify the filter class you want. There are multiple filter implementations:
+- not using levels - the classes from the filter namespace
+- using levels - the classes from the level namespace
+
+Choose any you wish:
+
+@code
+#include <boost/logging/format_fwd.hpp>
+
+// declare filter
+BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
+
+BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
+@endcode
+
+
+
+@section defining_your_logger Declaring/defining your logger class(es)
+
+@subsection defining_your_logger_scenario Declare/Define your logger using scenarios (the very easy way)
+
+When you use formatters and destinations, you can declare/define both your logger and filter based on how you'll use them (scenario::usage).
+Thus, you'll deal with the logger like this:
+
+@code
+#include <boost/logging/format_fwd.hpp>
+
+using namespace boost::logging::scenario::usage;
+typedef use<
+ // filter info
+ ...,
+ // how often does the logger change?
+ logger_::change::often<10>,
+ // what does the logger favor?
+ logger_::favor::speed> finder;
+
+// declare
+BOOST_DECLARE_LOG(g_log_err, finder::logger )
+
+// define
+BOOST_DEFINE_LOG(g_log_err, finder::logger )
+
+@endcode
+
+
+
+
+@subsection defining_your_logger_format_write Declare/Define your logger using logger_format_write (the easy way)
+
+When you use formatters and destinations, you can use the logger_format_write class. The template params you don't want to set,
+just leave them @c default_.
+
+@code
+#include <boost/logging/format_fwd.hpp>
+
+namespace b_l = boost::logging;
+typedef b_l::logger_format_write< b_l::default_, b_l::default_, b_l::writer::threading::on_dedicated_thread > log_type;
+
+// declare
+BOOST_DECLARE_LOG(g_l, log_type)
+
+// define
+BOOST_DEFINE_LOG(g_l, log_type)
+@endcode
+
+
+
+@subsection defining_your_logger_use_logger Declare/Define your logger using the logger class
+
+In case you don't use formatters and destinations, or have custom needs that the above methods can't satisfy, or
+just like to do things very manually, you can use the logger class directly:
+
+@code
+#include <boost/logging/logging.hpp>
+
+typedef logger< gather::ostream_like::return_str<>, destination::cout> log_type;
+
+// declare
+BOOST_DECLARE_LOG(g_l, log_type)
+
+// define
+BOOST_DEFINE_LOG(g_l, log_type)
+@endcode
+
+
+*/
+
+}}
Modified: sandbox/logging/boost/logging/detail/raw_doc/table_of_contents.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/table_of_contents.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/table_of_contents.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -16,16 +16,18 @@
- @ref common_scenario_using_tags
- @ref common_scenarios "More scenarios..."
- @ref scenario_multiple_files
- - @ref scenario_multiple_files_program
- - @ref scenario_multiple_files_log_h
- - @ref scenario_multiple_files_log_cpp
- - @ref scenario_multiple_files_main
- @ref starter_project
+- @ref defining_your_logger_filter
- @ref headers_to_include "Headers to #include"
- @ref scenario::usage "Choose the best filter/logger class, based on your application's needs"
- @ref tag "Using tags"
+
+need to modify the ..._fd.hpp file
+
+
+
- @ref workflow
- @ref workflow_introduction
- @ref workflow_filter
Modified: sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -115,7 +115,6 @@
See the
- the gather namespace - classes for gathering
- the gather::ostream_like - classes for gathering, using the cool "<<" operator
-- @ref macros_gathering "Macros for gathering" section.
Modified: sandbox/logging/boost/logging/format.hpp
==============================================================================
--- sandbox/logging/boost/logging/format.hpp (original)
+++ sandbox/logging/boost/logging/format.hpp 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -227,15 +227,16 @@
const destination_array & m_destinations;
};
- /**
- @brief Represents a simple router - first calls all formatters - in the order they were added, then all destinations - in the order they were added
+/**
+@brief Represents a simple router - first calls all formatters - in the order they were added, then all destinations - in the order they were added
- Example:
+Example:
@code
-typedef process_msg< gather::ostream_like::return_str<> , format_write<...> > process;
-logger<process, filter::no_ts> g_l;
-#define L_ if ( !g_l) ; else g_l->read_msg().gather().out()
+typedef logger< gather::ostream_like::return_str<> , format_write<...> > log_type;
+BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
+BOOST_DEFINE_LOG(g_l, log_type)
+#define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l, g_log_filter->is_enabled() )
// add formatters : [idx] [time] message [enter]
g_l->writer().add_formatter( write_idx() );
@@ -251,8 +252,9 @@
L_ << "testing " << i << i+1 << i+2;
@endcode
- In the above case, @c write_idx() is called, then @c write_time(), then @c append_newline(). Now, the destinations are called:
- @c write_to_cout(), and then @c write_to_file().
+In the above case:
+- First, the formatters are called: @c write_idx() is called, then @c write_time(), then @c append_newline().
+- Then, the destinations are called: @c write_to_cout(), and then @c write_to_file().
@@ -260,6 +262,8 @@
@param destination_base The base class for all destination classes from your application. See manipulator.
+@param lock_resource What class you use to do allow thread-safe access to an instance of this clas (used internally).
+
*/
template<
class formatter_base,
Modified: sandbox/logging/lib/logging/internal/vc8/loggingvc8/loggingvc8.vcproj
==============================================================================
--- sandbox/logging/lib/logging/internal/vc8/loggingvc8/loggingvc8.vcproj (original)
+++ sandbox/logging/lib/logging/internal/vc8/loggingvc8/loggingvc8.vcproj 2007-11-15 17:53:52 EST (Thu, 15 Nov 2007)
@@ -586,7 +586,7 @@
>
</File>
<File
- RelativePath="..\..\..\..\..\boost\logging\filter.hpp"
+ RelativePath="..\..\..\..\..\boost\logging\detail\filter.hpp"
>
</File>
<File
@@ -598,7 +598,7 @@
>
</File>
<File
- RelativePath="..\..\..\..\..\boost\logging\level.hpp"
+ RelativePath="..\..\..\..\..\boost\logging\detail\level.hpp"
>
</File>
<File
@@ -614,7 +614,7 @@
>
</File>
<File
- RelativePath="..\..\..\..\..\boost\logging\macros.hpp"
+ RelativePath="..\..\..\..\..\boost\logging\detail\macros.hpp"
>
</File>
<File
@@ -846,6 +846,10 @@
>
</File>
<File
+ RelativePath="..\..\..\..\..\boost\logging\detail\raw_doc\defining_your_logger_filter.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\..\..\boost\logging\detail\raw_doc\fixme.hpp"
>
</File>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk