Boost logo

Boost-Commit :

From: john.groups_at_[hidden]
Date: 2008-01-23 18:28:22


Author: jtorjo
Date: 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
New Revision: 42940
URL: http://svn.boost.org/trac/boost/changeset/42940

Log:
[logging]
v0.21.2, 24 jan 2008
- added named_logger - much easier to use the logging lib - doesn't require any advanced knowledge at all
- simplified examples, removed some of them from the "Scenarios" page; they're still found in the "Examples" section in the docs
Added:
   sandbox/logging/boost/logging/format/named_writer.hpp (contents, props changed)
   sandbox/logging/boost/logging/writer/named.hpp (contents, props changed)
Text files modified:
   sandbox/logging/boost/logging/detail/cache_before_init.hpp | 6
   sandbox/logging/boost/logging/detail/format_write_detail.hpp | 9 +
   sandbox/logging/boost/logging/detail/logger.hpp | 46 ++++++-----
   sandbox/logging/boost/logging/detail/logger_base.hpp | 19 ++++
   sandbox/logging/boost/logging/detail/macros.hpp | 18 ++--
   sandbox/logging/boost/logging/detail/manipulator.hpp | 33 +++++++-
   sandbox/logging/boost/logging/detail/raw_doc/acknowledgments.hpp | 1
   sandbox/logging/boost/logging/detail/raw_doc/after_destruction.hpp | 9 ++
   sandbox/logging/boost/logging/detail/raw_doc/breaking_changes.hpp | 2
   sandbox/logging/boost/logging/detail/raw_doc/changelog.hpp | 4
   sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp | 12 +-
   sandbox/logging/boost/logging/detail/raw_doc/headers_to_include.hpp | 12 +++
   sandbox/logging/boost/logging/detail/raw_doc/miscelaneous.hpp | 2
   sandbox/logging/boost/logging/detail/raw_doc/rationale.hpp | 2
   sandbox/logging/boost/logging/detail/raw_doc/scenarios.hpp | 90 ----------------------
   sandbox/logging/boost/logging/detail/raw_doc/scenarios_code.hpp | 81 +------------------
   sandbox/logging/boost/logging/detail/raw_doc/table_of_contents.hpp | 7 -
   sandbox/logging/boost/logging/detail/raw_doc/todo.hpp | 11 ++
   sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp | 16 ++--
   sandbox/logging/boost/logging/detail/time_format_holder.hpp | 13 ++
   sandbox/logging/boost/logging/format.hpp | 8 +-
   sandbox/logging/boost/logging/format/destination/file.hpp | 25 +++++-
   sandbox/logging/boost/logging/format/destination/named.hpp | 16 +++
   sandbox/logging/boost/logging/format/destination/rolling_file.hpp | 23 +++++
   sandbox/logging/boost/logging/format/formatter/high_precision_time.hpp | 20 +++-
   sandbox/logging/boost/logging/format/formatter/named_spacer.hpp | 17 ++++
   sandbox/logging/boost/logging/format/formatter/time.hpp | 19 +++-
   sandbox/logging/boost/logging/format_fwd.hpp | 35 ++++++++
   sandbox/logging/boost/logging/profile.hpp | 12 +-
   sandbox/logging/boost/logging/writer/on_dedicated_thread.hpp | 2
   sandbox/logging/lib/logging/internal/vc8/loggingvc8/loggingvc8.vcproj | 17 ++++
   sandbox/logging/lib/logging/internal/vc8/loggingvc8/test_now.cpp | 159 ++++++++++++---------------------------
   sandbox/logging/lib/logging/samples/scenarios/cache_before_init.cpp | 14 +-
   sandbox/logging/lib/logging/samples/scenarios/custom_fmt_dest.cpp | 6
   sandbox/logging/lib/logging/samples/scenarios/ded_loger_one_filter.cpp | 6
   sandbox/logging/lib/logging/samples/scenarios/mul_levels_mul_logers.cpp | 61 ++++-----------
   sandbox/logging/lib/logging/samples/scenarios/mul_levels_one_logger.cpp | 63 ++++-----------
   sandbox/logging/lib/logging/samples/scenarios/mul_loggers_one_filter.cpp | 14 +-
   sandbox/logging/lib/logging/samples/scenarios/no_levels_with_route.cpp | 6
   sandbox/logging/lib/logging/samples/scenarios/one_loger_one_filter.cpp | 37 ++-------
   sandbox/logging/lib/logging/samples/scenarios/ts_loger_one_filter.cpp | 6
   sandbox/logging/lib/logging/samples/scenarios/use_profiler.cpp | 4
   sandbox/logging/lib/logging/samples/scenarios/use_tss_ostringstream.cpp | 6
   sandbox/logging/lib/logging/tests/test_after_destroyed/test.cpp | 4
   44 files changed, 448 insertions(+), 525 deletions(-)

Modified: sandbox/logging/boost/logging/detail/cache_before_init.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/cache_before_init.hpp (original)
+++ sandbox/logging/boost/logging/detail/cache_before_init.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -112,7 +112,7 @@
         return !(m_cache.is_using_cache);
     }
 
- template<class writer_type> void turn_cache_off(const writer_type & writer) {
+ template<class writer_type> void turn_cache_off(const writer_type & writer_) {
         if ( is_cache_turned_off() )
             return; // already turned off
 
@@ -135,10 +135,10 @@
         for ( typename cache::message_array::iterator b = msgs.begin(), e = msgs.end(); b != e; ++b) {
             if ( !(b->is_enabled) )
                 // no filter
- writer( b->string );
+ writer_( b->string );
             else if ( b->is_enabled() )
                 // filter enabled
- writer( b->string );
+ writer_( b->string );
         }
     }
 

Modified: sandbox/logging/boost/logging/detail/format_write_detail.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/format_write_detail.hpp (original)
+++ sandbox/logging/boost/logging/detail/format_write_detail.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -63,8 +63,8 @@
 and then all destinations are called, in the order they were added. You can easily access the router() instance.
 
 @code
-typedef logger< gather::ostream_like::return_cache_str<> , format_write< ... > > log_type;
-BOOST_DECLARE_LOG(g_l, log_type)
+typedef logger< gather::ostream_like::return_cache_str<> , format_write< ... > > logger_type;
+BOOST_DECLARE_LOG(g_l, logger_type)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
@@ -142,6 +142,11 @@
     typedef typename formatter_base::ptr_type formatter_ptr;
     typedef typename destination_base::ptr_type destination_ptr;
 
+ typedef formatter_base formatter_base_type;
+ typedef destination_base destination_base_type;
+ typedef lock_resource lock_resource_type;
+
+
     format_write() : m_router(m_formatters, m_destinations) {}
 
 

Modified: sandbox/logging/boost/logging/detail/logger.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/logger.hpp (original)
+++ sandbox/logging/boost/logging/detail/logger.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -64,7 +64,7 @@
         typedef logger_base<gather_msg, default_> logger_base_type;
         using logger_base_type::cache;
 
- typedef logger<gather_msg, default_> self;
+ typedef logger<gather_msg, default_> self_type;
 
         logger() {}
         // we have virtual functions, lets have a virtual destructor as well - many thanks Martin Baeker!
@@ -76,17 +76,22 @@
         /**
             reads all data about a log message (gathers all the data about it)
         */
- gather_holder<self, gather_msg> read_msg() const { return gather_holder<self, gather_msg>(*this) ; }
+ gather_holder<self_type, gather_type> read_msg() const { return gather_holder<self_type, gather_type>(*this) ; }
+// gather_holder<self_type, gather_msg> read_msg() const { return gather_holder<self_type, gather_msg>(*this) ; }
 
         write_type & writer() { return m_writer; }
         const write_type & writer() const { return m_writer; }
 
+ void turn_cache_off() {
+ cache().turn_cache_off( call_do_write(*this) );
+ }
+
     private:
         struct call_do_write {
- const logger & self;
- call_do_write(const logger & self) : self(self) {}
+ const logger & self_;
+ call_do_write(const logger & self_) : self_(self_) {}
             void operator()(msg_type & msg) const {
- self.do_write(msg);
+ self_.do_write(msg);
             }
         };
     public:
@@ -97,9 +102,6 @@
             else
                 logger_base_type::call_after_destroyed(msg);
         }
- void turn_cache_off() {
- cache().turn_cache_off( call_do_write(*this) );
- }
 
         virtual void do_write(msg_type&) const = 0;
     private:
@@ -195,9 +197,9 @@
     This is usually done through a @ref macros_use "macro".
 
     @code
- typedef logger< ... > log_type;
+ typedef logger< ... > logger_type;
     BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
- BOOST_DECLARE_LOG(g_l, log_type)
+ BOOST_DECLARE_LOG(g_l, logger_type)
 
     #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
@@ -224,7 +226,7 @@
         typedef logger_base<gather_msg, write_msg> logger_base_type;
         using logger_base_type::cache;
 
- typedef logger<gather_msg, write_msg> self;
+ typedef logger<gather_msg, write_msg> self_type;
 
         BOOST_LOGGING_FORWARD_CONSTRUCTOR_INIT(logger,m_writer, init)
 
@@ -236,11 +238,15 @@
         /**
             reads all data about a log message (gathers all the data about it)
         */
- gather_holder<self, gather_type> read_msg() const { return gather_holder<self, gather_type>(*this) ; }
+ gather_holder<self_type, gather_type> read_msg() const { return gather_holder<self_type, gather_type>(*this) ; }
 
         write_msg & writer() { return m_writer; }
         const write_msg & writer() const { return m_writer; }
 
+ void turn_cache_off() {
+ cache().turn_cache_off( writer() );
+ }
+
         // called after all data has been gathered
         void on_do_write(msg_type & msg) const {
             if ( logger_base_type::is_still_alive() )
@@ -248,10 +254,6 @@
             else
                 logger_base_type::call_after_destroyed(msg);
         }
- void turn_cache_off() {
- cache().turn_cache_off( writer() );
- }
-
     private:
         void init() {
             logger_base_type::m_base.forward_to(this);
@@ -273,7 +275,7 @@
         using logger_base_type::cache;
 
 
- typedef logger<gather_msg, write_msg*> self;
+ typedef logger<gather_msg, write_msg*> self_type;
 
         logger(write_msg * writer = 0) : m_writer(writer) {
             logger_base_type::m_base.forward_to(this);
@@ -290,11 +292,15 @@
         /**
             reads all data about a log message (gathers all the data about it)
         */
- gather_holder<self, gather_msg> read_msg() const { return gather_holder<self, gather_msg>(*this) ; }
+ gather_holder<self_type, gather_msg> read_msg() const { return gather_holder<self_type, gather_msg>(*this) ; }
 
         write_msg & writer() { return *m_writer; }
         const write_msg & writer() const { return *m_writer; }
 
+ void turn_cache_off() {
+ cache().turn_cache_off( writer() );
+ }
+
         // called after all data has been gathered
         void on_do_write(msg_type & msg) const {
             if ( logger_base_type::is_still_alive() )
@@ -302,10 +308,6 @@
             else
                 logger_base_type::call_after_destroyed(msg);
         }
- void turn_cache_off() {
- cache().turn_cache_off( writer() );
- }
-
     private:
         write_msg *m_writer;
         // a base object - one that can be used to log messages, without having to know the full type of the log.

Modified: sandbox/logging/boost/logging/detail/logger_base.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/logger_base.hpp (original)
+++ sandbox/logging/boost/logging/detail/logger_base.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -137,6 +137,25 @@
             common_base_type::common_base()->set_after_destroyed(f);
         }
 
+ protected:
+ logger_base() {}
+ logger_base(const logger_base&) {}
+
+ private:
+ subclass_type & self() { return static_cast<subclass_type &>(*this); }
+ const subclass_type & self() const { return static_cast<const subclass_type &>(*this); }
+
+
+ public:
+
+ /** @brief Marks this logger as initialized
+
+ You might log messages before the logger is initialized. In this case, they are cached, and written to the logger,
+ when you mark it as "initialized"
+ */
+ void mark_as_initialized() {
+ self().turn_cache_off();
+ }
     };
 
 }}

Modified: sandbox/logging/boost/logging/detail/macros.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/macros.hpp (original)
+++ sandbox/logging/boost/logging/detail/macros.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -126,39 +126,39 @@
 @subsubsection BOOST_DECLARE_LOG BOOST_DECLARE_LOG - declaring a log
 
 @code
-BOOST_DECLARE_LOG(log_name, log_type)
+BOOST_DECLARE_LOG(log_name, logger_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)
+Note that @c logger_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)
+typedef logger_format_write< > logger_type;
+BOOST_DECLARE_LOG(g_l, logger_type)
 @endcode
 
 
 @subsubsection BOOST_DEFINE_LOG BOOST_DEFINE_LOG - defining a log
 
 @code
-BOOST_DEFINE_LOG(log_name, log_type)
+BOOST_DEFINE_LOG(log_name, logger_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;
+typedef logger_format_write< > logger_type;
 ...
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_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)
+BOOST_DEFINE_LOG_WITH_ARGS (log_name, logger_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.
@@ -229,7 +229,7 @@
 Example:
 @code
 BOOST_DECLARE_LOG_FILTER(g_log_level, boost::logging::level::holder )
-BOOST_DECLARE_LOG(g_log_err, log_type)
+BOOST_DECLARE_LOG(g_log_err, logger_type)
 
 #define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err(), g_log_level(), error )
 @endcode

Modified: sandbox/logging/boost/logging/detail/manipulator.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/manipulator.hpp (original)
+++ sandbox/logging/boost/logging/detail/manipulator.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -335,6 +335,13 @@
     typedef param_type param;
 
     virtual void operator()(param val) const = 0;
+
+ /** @brief Override this if you want to allow configuration through scripting
+
+ That is, this allows configuration of your manipulator (formatter/destination) at run-time.
+ */
+ virtual void configure(const hold_string_type& ) {}
+
 protected:
     // signify that we're only a base class - not to be used directly
     base() {}
@@ -368,9 +375,16 @@
     @brief Use this when implementing your own formatter or destination class. Don't use this directly. Use formatter::class_ or destination::class_
 */
 template<class type, implement_op_equal::type op_e, class base_type> struct class_
- : base_type,
- detail::op_equal_base<op_e>,
- boost::logging::op_equal::same_type_op_equal<type> {
+ : base_type,
+ detail::op_equal_base<op_e>,
+ boost::logging::op_equal::same_type_op_equal<type> {
+
+ /** @brief Override this if you want to allow configuration through scripting
+
+ That is, this allows configuration of your manipulator (formatter/destination) at run-time.
+ */
+ virtual void configure(const hold_string_type& ) {}
+
 };
 
 
@@ -458,7 +472,14 @@
 
 @sa boost::logging::destination::convert, boost::logging::formatter::convert
 */
-struct is_generic {};
+struct is_generic {
+
+ /** @brief Override this if you want to allow configuration through scripting
+
+ That is, this allows configuration of your manipulator (formatter/destination) at run-time.
+ */
+ virtual void configure(const hold_string_type& ) {}
+};
 
 namespace detail {
 
@@ -480,6 +501,10 @@
         virtual void operator()(param val) const {
             m_val.operator()(val);
         }
+
+ virtual void configure(const hold_string_type& str) {
+ m_val.configure(str);
+ }
     };
 }
 

Modified: sandbox/logging/boost/logging/detail/raw_doc/acknowledgments.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/acknowledgments.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/acknowledgments.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -16,6 +16,7 @@
 - Martin Baeker - for testing my lib, and pointing out problems
 - Thomas Kreisel - for testing my lib in Linux, providing patches, finding possible problems in my lib
 - Lucian Ciufudean - for giving me thorough feedback on the documentation, even though he's a Java freak...
+- Andrei Alexandrescu - for reminding me that the default syntax should be soooo easy... Thus, named_logger was born!
 
 */
 

Modified: sandbox/logging/boost/logging/detail/raw_doc/after_destruction.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/after_destruction.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/after_destruction.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -14,6 +14,15 @@
 
 
 \n\n
+FIXME this is obsolete, many thanks to Daniel Kruger ("destructing of global objects" thread)
+http://groups.google.ro/group/comp.lang.c++.moderated/tree/browse_frm/thread/17987673016b2098/d4c6bdcdca1e8fe9?hl=ro&rnum=1&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fbrowse_frm%2Fthread%2F17987673016b2098%3Fhl%3Dro%26#doc_aa38c20511f81615
+
+So the solution should be: if in a translation unit you have a static instance of some class, and in its destructor you might end up doing logging, you should include the logging header (which will do the initialization trick)
+--> same thing needs to apply to filters
+--> in BOOST_DECLARE_LOG/LOG_FILTER -> need to have the init trick.
+
+
+\n\n
 @section after_destruction_can_happen Can this happen?
 
 The short answer : yes. How? The order of inialization between translation units is not defined, thus the same applies

Modified: sandbox/logging/boost/logging/detail/raw_doc/breaking_changes.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/breaking_changes.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/breaking_changes.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -63,7 +63,7 @@
 @code
 // before version v0.20
 
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 // in code, "g_l" is used like a variable
 g_l->writer().add_formatter( formatter::idx(), "[%] " );

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 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -1,7 +1,9 @@
 /**
 @page page_changelog Changelog
 
-_at_section changelog_cur_ver Current Version: v0.21.1, 21 jan 2008
+@section changelog_cur_ver Current Version: v0.21.2, 24 jan 2008
+- added named_logger - much easier to use the logging lib - doesn't require any advanced knowledge at all
+- simplified examples, removed some of them from the "Scenarios" page; they're still found in the "Examples" section in the docs
 - should only fix bugs & update docs until review
 
 v0.20.16, 21 jan 2008

Modified: sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/defining_your_logger_filter.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -172,13 +172,13 @@
 #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;
+typedef b_l::logger_format_write< b_l::default_, b_l::default_, b_l::writer::threading::on_dedicated_thread > logger_type;
 
 // declare
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // define
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 @endcode
 
 
@@ -191,13 +191,13 @@
 @code
 #include <boost/logging/logging.hpp>
 
-typedef logger< gather::ostream_like::return_str<>, destination::cout> log_type;
+typedef logger< gather::ostream_like::return_str<>, destination::cout> logger_type;
 
 // declare
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // define
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 @endcode
 
 

Modified: sandbox/logging/boost/logging/detail/raw_doc/headers_to_include.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/headers_to_include.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/headers_to_include.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -3,6 +3,18 @@
 /**
 @page headers_to_include Headers to #include
 
+
+- when using the Named Writer (an easy interface to Formatters and Destinations)
+
+@code
+// when declaring logs
+#include <boost/logging/format_fwd.hpp>
+
+// when defining logs
+#include <boost/logging/format/named_writer.hpp>
+ @endcode
+
+
 - when using Formatters and Destinations
 
 @code

Modified: sandbox/logging/boost/logging/detail/raw_doc/miscelaneous.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/miscelaneous.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/miscelaneous.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -11,7 +11,7 @@
 Example:
 
 @code
-typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > log_type;
+typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > logger_type;
 @endcode
 
 @section misc_unicode Internationalization - Using Unicode charaters

Modified: sandbox/logging/boost/logging/detail/raw_doc/rationale.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/rationale.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/rationale.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -34,7 +34,7 @@
 When using BOOST_LOG_DECLARE/DEFINE, they internally declare/define a function:
 
 @code
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // equivalent to:
 implementation_defined g_l();

Modified: sandbox/logging/boost/logging/detail/raw_doc/scenarios.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/scenarios.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/scenarios.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -4,19 +4,10 @@
 @page common_scenarios Usage Scenarios (together with code)
 
 - @ref common_scenarios_1
-- @ref common_scenarios_2
-- @ref common_scenarios_3
-- @ref common_scenarios_4
 - @ref common_scenarios_5
 - @ref common_scenarios_6
-- @ref common_scenarios_7
-- @ref common_scenarios_8
-- @ref common_scenarios_9
-- @ref common_scenarios_10
 
 - @ref common_your_scenario
-- @ref common_scenario_using_tags
-- @ref common_scenario_profile
 
 - @ref scenario_multiple_files
     - @ref scenario_multiple_files_program
@@ -41,34 +32,7 @@
 
 
 
-_at_section common_scenarios_2 Scenario 2: Multiple levels, Multiple logging classes, Multiple destinations.
-
-_at_copydoc mul_levels_mul_logers
-
-_at_ref scenarios_code_2 "Click to see the code"
-\n\n\n
-
-
-
-_at_section common_scenarios_3 Scenario 3: No levels, One Logger, Multiple destinations, Custom route
-
-_at_copydoc no_levels_with_route
-
-_at_ref scenarios_code_3 "Click to see the code"
-\n\n\n
-
-
-
-_at_section common_scenarios_4 Scenario 4: No levels, Multiple Loggers, One Filter
-
-_at_copydoc mul_loggers_one_filter
-
-_at_ref scenarios_code_4 "Click to see the code"
-\n\n\n
-
-
-
-_at_section common_scenarios_5 Scenario 5: No levels, One Logger, One Filter
+@section common_scenarios_5 Scenario 2: No levels, One Logger, One Filter
 
 @copydoc one_loger_one_filter
 
@@ -77,7 +41,7 @@
 
 
 
-_at_section common_scenarios_6 Scenario 6: Fastest: Multiple Loggers, One Filter, Not using Formatters/Destinations, Not using <<
+@section common_scenarios_6 Scenario 3: Fastest: Multiple Loggers, One Filter, Not using Formatters/Destinations, Not using <<
 
 @copydoc fastest_no_ostr_like
 
@@ -86,39 +50,6 @@
 
 
 
-_at_section common_scenarios_7 Scenario 7: Fast: Multiple Loggers, One Filter, Not using Formatters/Destinations, Using <<
-
-_at_copydoc fastest_use_ostr_like
-
-_at_ref scenarios_code_7 "Click to see the code"
-\n\n\n
-
-
-
-_at_section common_scenarios_8 Scenario 8: Using custom formatters/destinations together with the existing formatters/destinations
-
-_at_copydoc custom_fmt_dest
-
-_at_ref scenarios_code_8 "Click to see the code"
-\n\n\n
-
-
-
-_at_section common_scenarios_9 Scenario 9: One Thread-safe Logger, One Filter
-
-_at_copydoc ts_loger_one_filter
-
-_at_ref scenarios_code_9 "Click to see the code"
-\n\n\n
-
-
-_at_section common_scenarios_10 Scenario 10: One Logger on a dedicated thread, One Filter
-
-_at_copydoc ded_loger_one_filter
-
-_at_ref scenarios_code_10 "Click to see the code"
-\n\n\n
-
 
 @section common_your_scenario Your Scenario : Find out logger and filter, based on your application's needs
 
@@ -129,23 +60,6 @@
 
 
 
-_at_section common_scenario_using_tags Using tags : file/line, thread id and time
-
-_at_copydoc using_tags
-
-_at_ref scenarios_code_using_tags "Click to see the code"
-\n\n\n
-
-
-
-
-_at_section common_scenario_profile Profiling the time spent while logging
-
-_at_copydoc use_profiler
-
-_at_ref scenarios_code_profile "Click to see the code"
-\n\n\n
-
 
 
 */

Modified: sandbox/logging/boost/logging/detail/raw_doc/scenarios_code.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/scenarios_code.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/scenarios_code.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -3,91 +3,34 @@
 /**
 @page scenarios_code Code for the common scenarios
 
-- @ref scenarios_code_1
-- @ref scenarios_code_2
-- @ref scenarios_code_3
-- @ref scenarios_code_4
-- @ref scenarios_code_5
-- @ref scenarios_code_6
-- @ref scenarios_code_7
-- @ref scenarios_code_8
-- @ref scenarios_code_9
-- @ref scenarios_code_10
+- @ref scenarios_code_mom
+- @ref scenarios_code_noo
+- @ref scenarios_code_mon
 
 - @ref common_your_scenario_code
 
 \n\n\n
-_at_section scenarios_code_1 Scenario 1, Common usage: Multiple levels, One logging class, Multiple destinations.
+@section scenarios_code_mom Scenario 1, Common usage: Multiple levels, One logging class, Multiple destinations.
 
 @include mul_levels_one_logger.cpp
 \n\n\n
 
 
 
-
-_at_section scenarios_code_2 Scenario 2: Multiple levels, Multiple logging classes, Multiple destinations
-
-_at_include mul_levels_mul_logers.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_3 Scenario 3: No levels, One Logger, Multiple destinations, Custom route
-
-_at_include no_levels_with_route.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_4 Scenario 4: No levels, Multiple Loggers, One Filter
-
-_at_include mul_loggers_one_filter.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_5 Scenario 5: No levels, One Logger, One Filter
+@section scenarios_code_noo Scenario 2: No levels, One Logger, One Filter
 
 @include one_loger_one_filter.cpp
 \n\n\n
 
 
 
-_at_section scenarios_code_6 Scenario 6: Fastest: Multiple Loggers, One Filter, Not using Formatters/Destinations, Not using <<
+@section scenarios_code_mon Scenario 3: Fastest: Multiple Loggers, One Filter, Not using Formatters/Destinations, Not using <<
 
 @include fastest_no_ostr_like.cpp
 \n\n\n
 
 
 
-_at_section scenarios_code_7 Scenario 7: Fast: Multiple Loggers, One Filter, Not using Formatters/Destinations, Using <<
-
-_at_include fastest_use_ostr_like.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_8 Scenario 8: Using custom formatters/destinations together with the existing formatters/destinations
-
-_at_include custom_fmt_dest.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_9 Scenario 9: One Thread-safe Logger, One Filter
-
-_at_include ts_loger_one_filter.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_10 Scenario 10: One Logger on a dedicated thread, One Filter
-
-_at_include ded_loger_one_filter.cpp
-\n\n\n
-
-
-
 @section common_your_scenario_code Your Scenario : Find out logger and filter, based on your application's needs
 
 @include your_scenario.cpp
@@ -95,18 +38,6 @@
 
 
 
-_at_section scenarios_code_using_tags Using tags : file/line, thread id and time
-
-_at_include using_tags.cpp
-\n\n\n
-
-
-
-_at_section scenarios_code_profile Profiling the time spent while logging
-
-_at_include use_profiler.cpp
-\n\n\n
-
 */
 
 }}

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 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -24,12 +24,9 @@
 
 - @ref common_scenarios
     - @ref common_scenarios_1
- - @ref common_scenarios_2
- - @ref common_scenarios_3
+ - @ref common_scenarios_5
+ - @ref common_scenarios_6
     - @ref common_your_scenario
- - @ref common_scenario_using_tags
- - @ref common_scenario_profile
- - @ref common_scenarios "More scenarios..."
     - @ref scenario_multiple_files
     - @ref starter_project
 

Modified: sandbox/logging/boost/logging/detail/raw_doc/todo.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/raw_doc/todo.hpp (original)
+++ sandbox/logging/boost/logging/detail/raw_doc/todo.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -26,6 +26,17 @@
 
 - @c normal must have helper to call on on_destructed - like, to be able to write to cout,etc
 
+- @c high based on formatter::named_spacer and destination::named, make it even easier to use
+ existing formatters, destinations (like, include them all, by default, with existing names)
+ thus, the user of the lib can just write ONE line, which will do:
+ specify formatter(s), and destination(s), and automatically turn the cache off.
+ i have to figure out how to specify params to send to inner formatters/destinations (like, "file(err.txt)" etc)
+
+- @c normal turn_cache_off() -> find better name, like mark_init_complete() (add a function named like this to call turn_cache_off()).
+
+- @c high scenario::use class - have ::gather and ::write typedefs !!!
+ this way we can have: named_logger< finder::gather , writer::named<finder::writer> >
+
 - @c high should see that if I have a tss* object, if used AFTER destruction, will not crash the application.
                     in other words, if I have tss_with_cache<int>, after this is destroyed, I should always reference the original int or so.
                     I need this when using a filter using TSS, after the filter has been destroyed.

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 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -49,16 +49,16 @@
 @code
 // Example 1 : 1 filter, 1 logger
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 
 // Example 2 : 1 filter (containing a level), several loggers
 BOOST_DECLARE_LOG_FILTER(g_log_level, level::holder )
-BOOST_DECLARE_LOG(g_log_err, log_type)
-BOOST_DECLARE_LOG(g_log_app, log_type)
-BOOST_DECLARE_LOG(g_log_dbg, log_type)
+BOOST_DECLARE_LOG(g_log_err, logger_type)
+BOOST_DECLARE_LOG(g_log_app, logger_type)
+BOOST_DECLARE_LOG(g_log_dbg, logger_type)
 
 #define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_dbg(), g_log_level(), debug )
 #define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err(), g_log_level(), error )
@@ -131,8 +131,8 @@
     }
 };
 
-typedef logger< gather::ostream_like::return_str<>, write_to_cout> log_type;
-BOOST_DECLARE_LOG(g_single_log, log_type)
+typedef logger< gather::ostream_like::return_str<>, write_to_cout> logger_type;
+BOOST_DECLARE_LOG(g_single_log, logger_type)
 BOOST_DECLARE_LOG_FILTER(g_filter, filter::no_ts)
 
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_single_log, g_filter->is_enabled() )
@@ -150,10 +150,10 @@
 For each log, you decide how messages are formatted and to what destinations they are written. Example:
 
 @code
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 

Modified: sandbox/logging/boost/logging/detail/time_format_holder.hpp
==============================================================================
--- sandbox/logging/boost/logging/detail/time_format_holder.hpp (original)
+++ sandbox/logging/boost/logging/detail/time_format_holder.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -1,4 +1,4 @@
-// Template.hpp
+// time_format_holder.hpp
 
 // Boost Logging library
 //
@@ -14,8 +14,8 @@
 // See http://www.torjo.com/log2/ for more details
 
 
-#ifndef JT28092007_TEMPLATE_HPP_DEFINED
-#define JT28092007_TEMPLATE_HPP_DEFINED
+#ifndef JT28092007_time_format_holder_HPP_DEFINED
+#define JT28092007_time_format_holder_HPP_DEFINED
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
@@ -58,8 +58,15 @@
         constructs a time format holder object
     */
     time_format_holder(const hold_string_type & format) : m_day(-1), m_month(-1), m_yy(-1), m_yyyy(-1), m_hour(-1), m_min(-1), m_sec(-1),m_millisec(-1),m_microsec(-1),m_nanosec(-1) {
+ set_format(format);
+ }
+
+ void set_format(const hold_string_type & format) {
         // format too big
         BOOST_ASSERT( format.size() < 64);
+ m_format.clear();
+
+ m_day = -1; m_month = -1; m_yy = -1; m_yyyy = -1; m_hour = -1; m_min = -1; m_sec = -1;m_millisec = -1;m_microsec = -1;m_nanosec = -1;
 
         typedef hold_string_type::size_type uint;
         uint day_idx = format.find(BOOST_LOG_STR("$dd"));

Modified: sandbox/logging/boost/logging/format.hpp
==============================================================================
--- sandbox/logging/boost/logging/format.hpp (original)
+++ sandbox/logging/boost/logging/format.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -231,9 +231,9 @@
 Example:
 
 @code
-typedef logger< gather::ostream_like::return_str<> , format_write<...> > log_type;
+typedef logger< gather::ostream_like::return_str<> , format_write<...> > logger_type;
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // add formatters : [idx] [time] message [enter]
@@ -330,8 +330,8 @@
     @code
     typedef logger< default_,
         writer::format_write< format_base, destination_base, format_and_write::simple<cache_string>,
- msg_route::with_route<format_base,destination_base> > > log_type;
- log_type g_l();
+ msg_route::with_route<format_base,destination_base> > > logger_type;
+ logger_type g_l();
 
     g_l()->writer().router().set_route()
         .fmt( formatter::time() )

Modified: sandbox/logging/boost/logging/format/destination/file.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/destination/file.hpp (original)
+++ sandbox/logging/boost/logging/format/destination/file.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -32,6 +32,7 @@
 #include <boost/logging/format/destination/convert_destination.hpp>
 #include <fstream>
 #include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
 
 namespace boost { namespace logging { namespace destination {
 
@@ -70,10 +71,17 @@
     }
 
     struct file_info {
- file_info(const std::string& name, file_settings settings) : name(name), out(name.c_str(), open_flags(settings) ), settings(settings) {}
+ file_info(const std::string& name, file_settings settings)
+ : name(name),
+ out( new std::basic_ofstream<char_type>( name.c_str(), open_flags(settings) )),
+ settings(settings) {}
+
+ void reopen() {
+ out = boost::shared_ptr< std::basic_ofstream<char_type> > ( new std::basic_ofstream<char_type>( name.c_str(), open_flags(settings) ) );
+ }
 
         std::string name;
- std::basic_ofstream<char_type> out;
+ boost::shared_ptr< std::basic_ofstream<char_type> > out;
         file_settings settings;
     };
 }
@@ -92,14 +100,23 @@
     */
     file_t(const std::string & file_name, file_settings set = file_settings() ) : non_const_context_base(file_name,set) {}
     template<class msg_type> void operator()(const msg_type & msg) const {
- convert_dest::write(msg, non_const_context_base::context().out );
+ convert_dest::write(msg, *( non_const_context_base::context().out) );
         if ( non_const_context_base::context().settings.flush_each_time() )
- non_const_context_base::context().out.flush();
+ non_const_context_base::context().out->flush();
     }
 
     bool operator==(const file_t & other) const {
         return non_const_context_base::context().name == other.context().name;
     }
+
+ /** configure through script
+ right now, you can only specify the file name
+ */
+ void configure(const hold_string_type & str) {
+ // configure - the file name, for now
+ non_const_context_base::context().name = str;
+ non_const_context_base::context().reopen();
+ }
 };
 
 /** @brief file_t with default values. See file_t

Modified: sandbox/logging/boost/logging/format/destination/named.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/destination/named.hpp (original)
+++ sandbox/logging/boost/logging/format/destination/named.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -75,6 +75,13 @@
             compute_write_steps();
         }
 
+ void configure(const string_type & name, const string_type & configure_str) {
+ typename data::write info(m_data);
+ destination_base_type * p = info->name_to_destination[name];
+ if ( p)
+ p->configure(configure_str);
+ }
+
         void format_string(const string_type & str) {
             { typename data::write info(m_data);
               info->format_string = str;
@@ -175,7 +182,7 @@
 #include <boost/logging/format/destination/named.hpp>
 @endcode
 */
-template<class lock_resource = default_, class destination_base = default_ > struct named_t : is_generic, non_const_context<detail::named_context<lock_resource,destination_base> > {
+template<class destination_base = default_, class lock_resource = default_ > struct named_t : is_generic, non_const_context<detail::named_context<lock_resource,destination_base> > {
     typedef non_const_context< detail::named_context<lock_resource,destination_base> > non_const_context_base;
     typedef hold_string_type string_type;
 
@@ -203,6 +210,13 @@
         return *this;
     }
 
+ void del(const string_type & name) {
+ non_const_context_base::context().del(name);
+ }
+
+ void configure_inner(const string_type & name, const string_type & configure_str) {
+ non_const_context_base::context().configure(name, configure_str);
+ }
 
     bool operator==(const named_t & other) const {
         return &( non_const_context_base::context()) == &( other.non_const_context_base::context());

Modified: sandbox/logging/boost/logging/format/destination/rolling_file.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/destination/rolling_file.hpp (original)
+++ sandbox/logging/boost/logging/format/destination/rolling_file.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -76,6 +76,16 @@
         rolling_file_info (const std::string& name_prefix, rolling_file_settings flags )
                 // many thanks to Martin Bauer
                 : m_name_prefix(name_prefix), m_flags(flags), m_cur_idx(0) {
+
+ namespace fs = boost::filesystem;
+ if ( fs::path::default_name_check_writable() )
+ // so that we don't get exceptions
+ fs::path::default_name_check( fs::no_check);
+
+ restart();
+ }
+
+ void restart() {
             namespace fs = boost::filesystem;
             
             if ( m_flags.initial_erase()) {
@@ -157,7 +167,7 @@
     And so on, until we reach name_prefix.N (N = file_count). When that gets fool, we start over, with name_prefix.1.
 */
 template<class convert_dest = do_convert_destination > struct rolling_file_t : is_generic, non_const_context<detail::rolling_file_info<convert_dest> > {
- typedef non_const_context<detail::rolling_file_info<convert_dest> > non_const_context_base;
+ typedef non_const_context< detail::rolling_file_info<convert_dest> > non_const_context_base;
 
     /**
         Constructs a rolling file
@@ -182,6 +192,17 @@
     void flush() {
         non_const_context_base::context().flush();
     }
+
+ /** configure through script
+ right now, you can only specify the file name prefix
+ */
+ void configure(const hold_string_type & str) {
+ // configure - the file prefix, for now
+ non_const_context_base::context().m_name_prefix = str;
+ non_const_context_base::context().m_cur_idx = 0;
+ non_const_context_base::context().restart();
+ }
+
 };
 
 /** @brief rolling_file_t with default values. See rolling_file_t

Modified: sandbox/logging/boost/logging/format/formatter/high_precision_time.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/formatter/high_precision_time.hpp (original)
+++ sandbox/logging/boost/logging/format/formatter/high_precision_time.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -66,13 +66,14 @@
 @param convert [optional] In case there needs to be a conversion between std::(w)string and the string that holds your logged message. See convert_format.
 For instance, you might use @ref boost::logging::optimize::cache_string_one_str "a cached_string class" (see @ref boost::logging::optimize "optimize namespace").
 */
-template<class convert = do_convert_format::prepend> struct high_precision_time_t : is_generic {
+template<class convert = do_convert_format::prepend> struct high_precision_time_t : is_generic, non_const_context<boost::logging::detail::time_format_holder> {
     typedef convert convert_type;
+ typedef non_const_context<boost::logging::detail::time_format_holder> non_const_context_base;
 
     /**
         constructs a high_precision_time object
     */
- high_precision_time_t(const hold_string_type & format) : m_format(format) {}
+ high_precision_time_t(const hold_string_type & format) : non_const_context_base(format) {}
 
     template<class msg_type> void write_high_precision_time(msg_type & msg, ::boost::posix_time::ptime val) const {
         char_type buffer[64];
@@ -97,7 +98,7 @@
             break;
         }
 
- m_format.write_time( buffer,
+ non_const_context_base::context().write_time( buffer,
             val.date().day(),
             val.date().month(),
             val.date().year(),
@@ -117,11 +118,18 @@
     }
 
     bool operator==(const high_precision_time_t & other) const {
- return m_format == other.m_format;
+ return non_const_context_base::context() == other.non_const_context_base::context() ;
     }
 
-private:
- boost::logging::detail::time_format_holder m_format;
+ /** @brief configure through script
+
+ the string = the time format
+ */
+ void configure(const hold_string_type & str) {
+ non_const_context_base::context().set_format(str);
+ }
+
+
 };
 
 

Modified: sandbox/logging/boost/logging/format/formatter/named_spacer.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/formatter/named_spacer.hpp (original)
+++ sandbox/logging/boost/logging/format/formatter/named_spacer.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -78,6 +78,13 @@
             compute_write_steps();
         }
 
+ void configure(const string_type & name, const string_type & configure_str) {
+ typename data::write info(m_data);
+ format_base_type * p = info->name_to_formatter[name];
+ if ( p)
+ p->configure(configure_str);
+ }
+
         void format_string(const string_type & str) {
             { typename data::write info(m_data);
               info->format_string = str;
@@ -234,7 +241,7 @@
 @bug Use_tags.cpp example when on dedicated thread, fails with named_spacer. If using the old code, it works.
 
 */
-template< class convert = default_, class lock_resource = default_, class format_base = default_ >
+template< class convert = default_, class format_base = default_, class lock_resource = default_ >
         struct named_spacer_t : is_generic, non_const_context< detail::named_spacer_context<convert,lock_resource,format_base> > {
 
     typedef non_const_context< detail::named_spacer_context<convert,lock_resource,format_base> > context_base;
@@ -255,6 +262,14 @@
         return *this;
     }
 
+ void del(const string_type & name) {
+ context_base::context().del(name);
+ }
+
+ void configure_inner(const string_type & name, const string_type & configure_str) {
+ context_base::context().configure(name, configure_str);
+ }
+
     template<class msg_type> void operator()(msg_type & msg) const {
         context_base::context().write(msg);
     }

Modified: sandbox/logging/boost/logging/format/formatter/time.hpp
==============================================================================
--- sandbox/logging/boost/logging/format/formatter/time.hpp (original)
+++ sandbox/logging/boost/logging/format/formatter/time.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -51,19 +51,20 @@
 @param convert [optional] In case there needs to be a conversion between std::(w)string and the string that holds your logged message. See convert_format.
 For instance, you might use @ref boost::logging::optimize::cache_string_one_str "a cached_string class" (see @ref boost::logging::optimize "optimize namespace").
 */
-template<class convert = do_convert_format::prepend> struct time_t : is_generic {
+template<class convert = do_convert_format::prepend> struct time_t : is_generic, non_const_context<boost::logging::detail::time_format_holder> {
     typedef convert convert_type;
+ typedef non_const_context<boost::logging::detail::time_format_holder> non_const_context_base;
 
     /**
         constructs a time object
     */
- time_t(const hold_string_type & format) : m_format(format) {}
+ time_t(const hold_string_type & format) : non_const_context_base(format) {}
 
     template<class msg_type> void write_time(msg_type & msg, ::time_t val) const {
         char_type buffer[64];
 
         tm details = *localtime( &val);
- m_format.write_time( buffer, details.tm_mday, details.tm_mon + 1, details.tm_year + 1900, details.tm_hour, details.tm_min, details.tm_sec);
+ non_const_context_base::context().write_time( buffer, details.tm_mday, details.tm_mon + 1, details.tm_year + 1900, details.tm_hour, details.tm_min, details.tm_sec);
 
         convert::write(buffer, msg);
     }
@@ -74,11 +75,17 @@
     }
 
     bool operator==(const time_t & other) const {
- return m_format == other.m_format;
+ return non_const_context_base::context() == other.non_const_context_base::context();
+ }
+
+ /** @brief configure through script
+
+ the string = the time format
+ */
+ void configure(const hold_string_type & str) {
+ non_const_context_base::context().set_format(str);
     }
 
-private:
- boost::logging::detail::time_format_holder m_format;
 };
 
 

Added: sandbox/logging/boost/logging/format/named_writer.hpp
==============================================================================
--- (empty file)
+++ sandbox/logging/boost/logging/format/named_writer.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -0,0 +1,29 @@
+// named_writer.hpp
+
+// Boost Logging library
+//
+// Author: John Torjo, www.torjo.com
+//
+// Copyright (C) 2007 John Torjo (see www.torjo.com for email)
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org for updates, documentation, and revision history.
+// See http://www.torjo.com/log2/ for more details
+
+
+#ifndef JT28092007_format_named_writer_HPP_DEFINED
+#define JT28092007_format_named_writer_HPP_DEFINED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/logging/writer/named.hpp>
+
+
+#endif
+
+

Modified: sandbox/logging/boost/logging/format_fwd.hpp
==============================================================================
--- sandbox/logging/boost/logging/format_fwd.hpp (original)
+++ sandbox/logging/boost/logging/format_fwd.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -66,10 +66,10 @@
 #if defined(BOOST_LOG_DEFINE_LOGS)
 #include <boost/logging/format.hpp>
 
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 #endif
 
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 BOOST_DECLARE_LOG_FILTER(g_l_filter, level::holder)
 
 #define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), debug ) << "[dbg] "
@@ -136,6 +136,37 @@
     typedef typename detail::format_find_gather<gather>::type gather_type;
 };
 
+namespace writer {
+ template<class format_write_ = default_ > struct named ;
+}
+
+/** @brief named_logger<...>::type finds a logger that uses @ref writer::named<> "Named Formatters and Destinations"
+
+@code
+#include <boost/logging/format/named_writer.hpp>
+@endcode
+
+Example:
+@code
+typedef boost::logging::named_logger<>::type logger_type;
+@endcode
+
+Setting the formatters and destinations to write to is extremely simple:
+
+@code
+// first param - the formatter(s) , second param : the destination(s)
+g_l()->writer().write("%time%($hh:$mm.$ss.$mili) [%idx%] |\n", "cout file(out.txt) debug");
+@endcode
+
+To see the syntax, see writer::named
+
+*/
+template<class gather = default_> struct named_logger {
+ typedef typename detail::format_find_gather<gather>::type gather_type;
+
+ /** @copydoc named_logger */
+ typedef logger< gather_type, writer::named<> > type;
+};
 
 }}
 

Modified: sandbox/logging/boost/logging/profile.hpp
==============================================================================
--- sandbox/logging/boost/logging/profile.hpp (original)
+++ sandbox/logging/boost/logging/profile.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -283,11 +283,11 @@
 #include <boost/logging/format_fwd.hpp>
 
 namespace bl = boost::logging ;
-typedef bl::logger_format_write< > log_type;
+typedef bl::logger_format_write< > logger_type;
 
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 ...
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 @endcode
 
@@ -300,11 +300,11 @@
 
 namespace bl = boost::logging ;
 typedef bl::logger_format_write< > raw_log_type;
-typedef bl::profile::compute_for_logger<raw_log_type>::type log_type;
+typedef bl::profile::compute_for_logger<raw_log_type>::type logger_type;
 
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 ...
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 @endcode
 

Added: sandbox/logging/boost/logging/writer/named.hpp
==============================================================================
--- (empty file)
+++ sandbox/logging/boost/logging/writer/named.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -0,0 +1,315 @@
+// named_writer.hpp
+
+// Boost Logging library
+//
+// Author: John Torjo, www.torjo.com
+//
+// Copyright (C) 2007 John Torjo (see www.torjo.com for email)
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org for updates, documentation, and revision history.
+// See http://www.torjo.com/log2/ for more details
+
+
+#ifndef JT28092007_named_writer_HPP_DEFINED
+#define JT28092007_named_writer_HPP_DEFINED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/logging/format_ts.hpp>
+
+// all destinations
+#include <boost/logging/format/destination/file.hpp>
+#include <boost/logging/format/destination/named.hpp>
+#include <boost/logging/format/destination/rolling_file.hpp>
+
+// all formats
+#include <boost/logging/format/formatter/named_spacer.hpp>
+#include <boost/logging/format/formatter/thread_id.hpp>
+
+#ifndef __GNUC__
+// Boost 1.33.1 - GCC has error compiling microsec_clock
+#include <boost/logging/format/formatter/high_precision_time.hpp>
+namespace boost { namespace logging { namespace detail {
+ typedef formatter::high_precision_time formatter_time_type ;
+ typedef formatter::high_precision_time_t<formatter::do_convert_format::append> formatter_time_type_append ;
+}}}
+#else
+#include <boost/logging/format/formatter/time.hpp>
+namespace boost { namespace logging { namespace detail {
+ typedef formatter::time formatter_time_type ;
+ typedef formatter::time_t<formatter::do_convert_format::append> formatter_time_type_append ;
+}}}
+#endif
+
+
+namespace boost { namespace logging { namespace writer {
+
+/**
+@brief Composed of a named formatter and a named destinations. Thus, you can specify the formatting and destinations as strings
+
+@code
+#include <boost/logging/format/named_writer.hpp>
+@endcode
+
+
+Contains a very easy interface for using formatters and destinations:
+- at construction, specify 2 params: the formatter string and the destinations string
+
+Setting the formatters and destinations to write to is extremely simple:
+
+@code
+// first param - the formatter(s) , second param : the destination(s)
+g_l()->writer().write("%time%($hh:$mm.$ss.$mili) [%idx%] |\n", "cout file(out.txt) debug");
+
+// set the formatter(s)
+g_l()->writer().format("%time%($hh:$mm.$ss.$mili) [%idx%] |\n");
+
+g_l()->writer().destination("cout file(out.txt) debug");
+@endcode
+
+The syntax of the format string:
+
+The syntax of the destination string:
+
+
+FIXME - need to allow tags by default, here!
+
+@param format_write_ the underlying format writer
+*/
+template<class format_write_ /* = default_ */ > struct named {
+ typedef typename use_default< format_write_, format_write< formatter::base<> , destination::base<> > >::type format_write_type;
+
+ typedef typename format_write_type::formatter_base_type formatter_base_type;
+ typedef typename format_write_type::destination_base_type destination_base_type;
+ typedef typename format_write_type::lock_resource_type lock_resource_type;
+
+ typedef hold_string_type string_type;
+
+ named() {
+ m_writer.add_formatter( m_format_before);
+ m_writer.add_formatter( m_format_after);
+ m_writer.add_destination( m_destination);
+
+ init();
+ }
+
+ /** @brief sets the format string: what should be before, and what after the original message, separated by "|"
+
+ Example: \n
+ "[%idx%] |\n" - this writes "[%idx%] " before the message, and "\n" after the message
+
+ If "|" is not present, the whole message is prepended to the message
+ */
+ void format(const string_type & format_str) {
+ m_format_str = format_str;
+
+ typename string_type::size_type idx = format_str.find('|');
+ string_type before, after;
+ if ( idx != string_type::npos) {
+ before = format_str.substr(0, idx);
+ after = format_str.substr(idx + 1);
+ }
+ else
+ before = format_str;
+
+ format( before, after);
+ };
+
+ /** @brief sets the format strings (what should be before, and what after the original message)
+ */
+ void format(const string_type & format_before_str, const string_type & format_after_str) {
+ m_format_before_str = format_before_str;
+ m_format_after_str = format_after_str;
+
+ set_and_configure( m_format_before, format_before_str, parse_formatter() );
+ set_and_configure( m_format_after, format_after_str, parse_formatter() );
+ };
+
+ /** @brief sets the destinations string - where should logged messages be outputted
+ */
+ void destination(const string_type & destination_str) {
+ m_destination_str = destination_str;
+ set_and_configure( m_destination, destination_str, parse_destination() );
+ }
+
+ /** @brief Specifies the formats and destinations in one step
+ */
+ void write(const string_type & format_str, const string_type & destination_str) {
+ format( format_str);
+ destination( destination_str);
+ }
+
+ const string_type & format() const { return m_format_str; }
+ const string_type & destination() const { return m_destination_str; }
+
+ template<class msg_type> void operator()(msg_type & msg) const {
+ m_writer(msg);
+ }
+
+ /** @brief Replaces a destination from the named destination.
+
+ You can use this, for instance, when you want to share a destination between multiple named writers.
+ */
+ template<class destination> void replace_destination(const string_type & name, destination d) {
+ m_destination.del(name);
+ m_destination.add(name, d);
+ }
+
+ /** @brief Replaces a formatter from the named formatter.
+
+ You can use this, for instance, when you want to share a formatter between multiple named writers.
+ */
+ template<class formatter> void replace_formatter(const string_type & name, formatter d) {
+ if ( m_format_before_str.find(name) != string_type::npos) {
+ m_format_before.del(name);
+ m_format_before.add(name, d);
+ }
+
+ if ( m_format_after_str.find(name) != string_type::npos) {
+ m_format_after.del(name);
+ m_format_after.add(name, d);
+ }
+ }
+
+private:
+ struct parse_destination {
+ bool has_manipulator_name() const { return !m_manipulator.empty(); }
+ string_type get_manipulator_name() const {
+ BOOST_ASSERT( has_manipulator_name() );
+ if ( m_manipulator[0] == '-' || m_manipulator[0] == '+')
+ // + or - -> turning on or off a destination
+ return m_manipulator.substr(1);
+ else
+ return m_manipulator;
+ }
+ void clear() { m_manipulator.clear(); }
+
+ void add(char_type c) {
+ // destination always follows ' '
+ if ( c == ' ')
+ clear();
+ else
+ m_manipulator += c;
+ }
+ private:
+ string_type m_manipulator;
+ };
+
+ struct parse_formatter {
+ // formatter starts and ends with %
+ bool has_manipulator_name() const {
+ if ( m_manipulator.empty() )
+ return false;
+ if ( m_manipulator.size() > 1)
+ if ( m_manipulator[0] == '%' && (*m_manipulator.rbegin() == '%') )
+ return true;
+
+ return false;
+ }
+
+ string_type get_manipulator_name() const {
+ BOOST_ASSERT( has_manipulator_name() );
+ // ignore starting and ending %
+ return m_manipulator.substr( 1, m_manipulator.size() - 2);
+ }
+ void clear() { m_manipulator.clear(); }
+
+ void add(char_type c) {
+ if ( has_manipulator_name() )
+ // was a manipulator until now
+ clear();
+
+ if ( c == '%') {
+ m_manipulator += c;
+ if ( !has_manipulator_name() )
+ // it could be the start of a formatter
+ m_manipulator = '%';
+ }
+ else if ( m_manipulator.empty())
+ ; // ignore this char - not from a manipulator
+ else if ( m_manipulator[0] == '%')
+ m_manipulator += c;
+ else
+ // manipulator should always start with %
+ BOOST_ASSERT(false);
+ }
+ private:
+ string_type m_manipulator;
+ };
+
+
+ template<class manipulator, class parser_type> void set_and_configure(manipulator & manip, const string_type & name, parser_type parser) {
+ // need to parse string
+ string_type prev ;
+ bool parsing_params = false;
+ string_type params;
+ string_type stripped_str;
+ for ( typename string_type::const_iterator b = name.begin(), e = name.end(); b != e; ++b) {
+ if ( (*b == '(') && !parsing_params) {
+ if ( parser.has_manipulator_name() ) {
+ parsing_params = true;
+ params.clear();
+ }
+ }
+ else if ( (*b == ')') && parsing_params) {
+ BOOST_ASSERT ( parser.has_manipulator_name() );
+ manip.configure_inner( parser.get_manipulator_name(), params);
+ parser.clear();
+ parsing_params = false;
+ }
+ else {
+ if ( parsing_params)
+ params += *b;
+ else {
+ stripped_str += *b;
+ parser.add( *b);
+ }
+ }
+ }
+ manip.string( stripped_str);
+ }
+
+private:
+ void init() {
+ m_format_before
+ .add( BOOST_LOG_STR("idx"), formatter::idx() )
+ .add( BOOST_LOG_STR("time"), ::boost::logging::detail::formatter_time_type( BOOST_LOG_STR("$hh:$mm:$ss") ) )
+ .add( BOOST_LOG_STR("thread_id"), formatter::thread_id() );
+
+ m_format_after
+ .add( BOOST_LOG_STR("idx"), formatter::idx_t<formatter::do_convert_format::append>() )
+ .add( BOOST_LOG_STR("time"), ::boost::logging::detail::formatter_time_type_append( BOOST_LOG_STR("$hh:$mm:$ss") ) )
+ .add( BOOST_LOG_STR("thread_id"), formatter::thread_id_t<formatter::do_convert_format::append>() );
+
+ m_destination
+ .add( BOOST_LOG_STR("file"), destination::file("out.txt") )
+ .add( BOOST_LOG_STR("file2"), destination::file("out.txt") )
+ .add( BOOST_LOG_STR("rol_file"), destination::rolling_file("out.txt") )
+ .add( BOOST_LOG_STR("rol_file2"), destination::rolling_file("out.txt") )
+ .add( BOOST_LOG_STR("cout"), destination::cout() )
+ .add( BOOST_LOG_STR("debug"), destination::dbg_window() );
+ }
+
+private:
+ formatter::named_spacer_t< formatter::do_convert_format::prepend, formatter_base_type, lock_resource_type > m_format_before;
+ formatter::named_spacer_t< formatter::do_convert_format::append, formatter_base_type, lock_resource_type > m_format_after;
+ destination::named_t< destination_base_type, lock_resource_type > m_destination;
+ format_write_type m_writer;
+
+ string_type m_format_str;
+ string_type m_format_before_str, m_format_after_str;
+ string_type m_destination_str;
+};
+
+}}}
+
+
+#endif
+
+

Modified: sandbox/logging/boost/logging/writer/on_dedicated_thread.hpp
==============================================================================
--- sandbox/logging/boost/logging/writer/on_dedicated_thread.hpp (original)
+++ sandbox/logging/boost/logging/writer/on_dedicated_thread.hpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -68,7 +68,7 @@
 To transform a @b logger into on-dedicated-thread (thread-safe) writer, simply specify @c on_dedicated_thread as the thread safety:
 
 @code
-typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > log_type;
+typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > logger_type;
 @endcode
 
 Of if you're using @ref boost::logging::scenario::usage scenarios, specify @c speed for the @c logger::favor_ :

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 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -557,6 +557,10 @@
>
                                 </File>
                                 <File
+ RelativePath="..\..\..\..\..\boost\logging\format\named_writer.hpp"
+ >
+ </File>
+ <File
                                         RelativePath="..\..\..\..\..\boost\logging\format\op_equal.hpp"
>
                                 </File>
@@ -645,6 +649,10 @@
>
                                 </File>
                                 <File
+ RelativePath="..\..\..\..\..\boost\logging\writer\named.hpp"
+ >
+ </File>
+ <File
                                         RelativePath="..\..\..\..\..\boost\logging\writer\on_dedicated_thread.hpp"
>
                                 </File>
@@ -930,7 +938,6 @@
>
                                 <FileConfiguration
                                         Name="Test|Win32"
- ExcludedFromBuild="true"
>
                                         <Tool
                                                 Name="VCCLCompilerTool"
@@ -952,6 +959,14 @@
                         <File
                                 RelativePath="..\..\..\samples\scenarios\use_profiler.cpp"
>
+ <FileConfiguration
+ Name="Test|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
                         </File>
                         <File
                                 RelativePath="..\..\..\samples\scenarios\use_tss_ostringstream.cpp"

Modified: sandbox/logging/lib/logging/internal/vc8/loggingvc8/test_now.cpp
==============================================================================
--- sandbox/logging/lib/logging/internal/vc8/loggingvc8/test_now.cpp (original)
+++ sandbox/logging/lib/logging/internal/vc8/loggingvc8/test_now.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -1,153 +1,90 @@
-/**
-_at_example custom_fmt_dest.cpp
 
-_at_copydoc custom_fmt_dest
 
-_at_page custom_fmt_dest custom_fmt_dest.cpp Example
 
-This example shows you how easy it is to add your custom formatter /destination classes.
+#include <boost/logging/format_fwd.hpp>
+#include <boost/logging/format/named_writer.hpp>
 
-This usage:
-- You have one logger
-- You have one filter, which can be turned on or off
-- You want to format the message before it's written
-- The logger has several log destinations
- - The output goes to console, debug output window, and a file called out.txt - as XML
- - Formatting - prefix each message by its start time, its index, and append newline
+// Step 3 : Specify your logging class(es)
+typedef boost::logging::named_logger<>::type logger_type;
 
-\n\n
-Custom classes:
-- secs_since_start - custom formatter
-- as_xml - custom destination
 
+// Step 4: declare which filters and loggers you'll use (usually in a header file)
+BOOST_DECLARE_LOG_FILTER(g_log_level, boost::logging::level::holder ) // holds the application log level
+BOOST_DECLARE_LOG(g_log_err, logger_type)
+BOOST_DECLARE_LOG(g_log_app, logger_type)
+BOOST_DECLARE_LOG(g_log_dbg, logger_type)
 
-\n\n
-Optimizations:
-- use a cache string (from optimize namespace), in order to make formatting the message faster
+// Step 5: define the macros through which you'll log
+#define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_dbg(), g_log_level(), debug ) << "[dbg] "
+#define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err(), g_log_level(), error )
+#define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_app(), g_log_level(), info ) << "[app] "
 
 
-\n\n
-The output will look similar to this one:
+// Step 6: Define the filters and loggers you'll use (usually in a source file)
+BOOST_DEFINE_LOG_FILTER(g_log_level, boost::logging::level::holder )
+BOOST_DEFINE_LOG(g_log_err, logger_type)
+BOOST_DEFINE_LOG(g_log_app, logger_type)
+BOOST_DEFINE_LOG(g_log_dbg, logger_type)
 
+using namespace boost::logging;
 
-The console and the debug window will be the same:
-_at_code
-+6s [1] this is so cool 1
-+6s [2] this is so cool again 2
-+7s [3] hello, world
-+7s [4] good to be back ;) 3
-_at_endcode
+void mul_levels_mul_logers_example() {
+ // reuse the same destination for 2 logs
+ destination::file out("out.txt");
+ g_log_app()->writer().replace_destination("file", out);
+ g_log_dbg()->writer().replace_destination("file", out);
+ // formatting (first param) and destinations (second param)
+ g_log_err()->writer().write("[%idx%] %time%($hh:$mm.$ss) |\n", "file(err.txt)");
+ g_log_app()->writer().write("[%idx%] %time%($hh:$mm.$ss) |\n", "file cout");
+ g_log_dbg()->writer().write("[%idx%] %time%($hh:$mm.$ss) |\n", "file cout debug");
 
+ g_log_app()->mark_as_initialized();
+ g_log_err()->mark_as_initialized();
+ g_log_dbg()->mark_as_initialized();
 
-The out.txt file will look like this:
 
 
-_at_code
-<msg>+6s [1] this is so cool 1
-</msg>
-<msg>+6s [2] this is so cool again 2
-</msg>
-<msg>+7s [3] hello, world
-</msg>
-<msg>+7s [4] good to be back ;) 3
-</msg>
-_at_endcode
 
-*/
 
 
-#include <boost/logging/format_fwd.hpp>
-#include <boost/logging/profile.hpp>
 
-// Step 1: Optimize : use a cache string, to make formatting the message faster
-BOOST_LOG_FORMAT_MSG( optimize::cache_string_one_str<> )
 
-#include <boost/logging/format.hpp>
-using namespace boost::logging;
 
-// Step 3 : Specify your logging class(es)
-typedef logger_format_write< default_, default_, writer::threading::no_ts > raw_log_type;
-//typedef raw_log_type log_type;
-typedef profile::compute_for_logger<raw_log_type>::type log_type;
+ g_log_err()->writer().write("%idx%/ [%time%($mm.$ss.$mili)] |\n", "file(err.txt)");
+ g_log_app()->writer().write("%idx%/ [%time%($mm.$ss.$mili)] |\n", "file cout");
+ g_log_dbg()->writer().write("%idx%/ [%time%($mm.$ss.$mili)] |\n", "file cout debug");
 
-// Step 4: declare which filters and loggers you'll use (usually in a header file)
-BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
-
-// Step 5: define the macros through which you'll log
-#define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
-
-// Step 6: Define the filters and loggers you'll use (usually in a source file)
-BOOST_DEFINE_LOG(g_l, log_type)
-BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
 
 
 
-// Example of custom formatter:
-// dump the no. of seconds since start of program
-struct secs_since_start : formatter::class_<secs_since_start, formatter::implement_op_equal::no_context> {
- ::time_t m_start;
- secs_since_start() : m_start( ::time(0) ) {}
- void operator()(param str) const {
- ::time_t now = ::time(0);
- std::stringstream out;
- out << "+" << (int)(now-m_start) << "s ";
- str.prepend_string( out.str() );
- }
-};
-
-// Example of custom destination:
-// Dump each message as XML
-struct as_xml :
- destination::class_<as_xml, destination::implement_op_equal::has_context>,
- destination::non_const_context<std::ofstream> {
-
- std::string m_name;
- as_xml(const char* name) : non_const_context_base(name), m_name(name) {}
- void operator()(param str) const {
- context() << "<msg>" << str << "</msg>" << std::endl;
- }
-
- bool operator==(const as_xml& other) const { return m_name == other.m_name; }
-};
-
-
-void custom_fmt_dest_example() {
- // Step 7: add formatters and destinations
- // That is, how the message is to be formatted and where should it be written to
-
- g_l()->writer().add_formatter( formatter::idx(), "[%] " );
- g_l()->writer().add_formatter( formatter::append_newline() );
- g_l()->writer().add_formatter( secs_since_start() );
-
- g_l()->writer().add_destination( destination::cout() );
- g_l()->writer().add_destination( destination::dbg_window() );
- g_l()->writer().add_destination( as_xml("out.txt") );
- g_l()->turn_cache_off();
 
     // Step 8: use it...
     int i = 1;
- L_ << "this is so cool " << i++;
- L_ << "this is so cool again " << i++;
+ LDBG_ << "this is so cool " << i++;
+ LDBG_ << "this is so cool again " << i++;
+ LERR_ << "first error " << i++;
 
     std::string hello = "hello", world = "world";
- L_ << hello << ", " << world;
-
- g_log_filter()->set_enabled(false);
- L_ << "this will not be written to the log";
- L_ << "this won't be written to the log";
+ LAPP_ << hello << ", " << world;
 
- g_log_filter()->set_enabled(true);
- L_ << "good to be back ;) " << i++;
+ g_log_level()->set_enabled(level::error);
+ LDBG_ << "this will not be written anywhere";
+ LAPP_ << "this won't be written anywhere either";
+
+ g_log_level()->set_enabled(level::info);
+ LAPP_ << "good to be back ;) " << i++;
+ LERR_ << "second error " << i++;
 
     // Step 9 : Enjoy!
 }
 
 
 
+
 int main() {
- custom_fmt_dest_example();
+ mul_levels_mul_logers_example();
 }
 
 
 // End of file
+

Modified: sandbox/logging/lib/logging/samples/scenarios/cache_before_init.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/cache_before_init.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/cache_before_init.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -70,22 +70,22 @@
 
 #include <boost/logging/format.hpp>
 
-typedef boost::logging::logger_format_write< > log_type;
+typedef boost::logging::logger_format_write< > logger_type;
 
 
 BOOST_DECLARE_LOG_FILTER(g_log_level, boost::logging::level::holder ) // holds the application log level
-BOOST_DECLARE_LOG(g_log_err, log_type)
-BOOST_DECLARE_LOG(g_log_app, log_type)
-BOOST_DECLARE_LOG(g_log_dbg, log_type)
+BOOST_DECLARE_LOG(g_log_err, logger_type)
+BOOST_DECLARE_LOG(g_log_app, logger_type)
+BOOST_DECLARE_LOG(g_log_dbg, logger_type)
 
 #define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_dbg(), g_log_level(), debug ) << "[dbg] "
 #define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err(), g_log_level(), error )
 #define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_app(), g_log_level(), info ) << "[app] "
 
 BOOST_DEFINE_LOG_FILTER(g_log_level, boost::logging::level::holder )
-BOOST_DEFINE_LOG(g_log_err, log_type)
-BOOST_DEFINE_LOG(g_log_app, log_type)
-BOOST_DEFINE_LOG(g_log_dbg, log_type)
+BOOST_DEFINE_LOG(g_log_err, logger_type)
+BOOST_DEFINE_LOG(g_log_app, logger_type)
+BOOST_DEFINE_LOG(g_log_dbg, logger_type)
 
 using namespace boost::logging;
 

Modified: sandbox/logging/lib/logging/samples/scenarios/custom_fmt_dest.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/custom_fmt_dest.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/custom_fmt_dest.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -66,18 +66,18 @@
 using namespace boost::logging;
 
 // Step 3 : Specify your logging class(es)
-typedef logger_format_write< default_, default_, writer::threading::no_ts > log_type;
+typedef logger_format_write< default_, default_, writer::threading::no_ts > logger_type;
 
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
 
 

Modified: sandbox/logging/lib/logging/samples/scenarios/ded_loger_one_filter.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/ded_loger_one_filter.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/ded_loger_one_filter.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -67,19 +67,19 @@
 
 // Step 3 : Specify your logging class(es)
 // In our case, we're also writing on a dedidcated thread
-typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > log_type;
+typedef logger_format_write< default_, default_, writer::threading::on_dedicated_thread > logger_type;
 
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 void do_sleep(int ms) {
     using namespace boost;

Modified: sandbox/logging/lib/logging/samples/scenarios/mul_levels_mul_logers.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/mul_levels_mul_logers.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/mul_levels_mul_logers.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -59,63 +59,36 @@
 
 
 
-#include <boost/logging/format_fwd.hpp>
-
-// Step 1: Optimize : use a cache string, to make formatting the message faster
-BOOST_LOG_FORMAT_MSG( optimize::cache_string_one_str<> )
-
-#include <boost/logging/format.hpp>
-
-// Step 3 : Specify your logging class(es)
-typedef boost::logging::logger_format_write< > log_type;
-
-
-// Step 4: declare which filters and loggers you'll use (usually in a header file)
-BOOST_DECLARE_LOG_FILTER(g_log_level, boost::logging::level::holder ) // holds the application log level
-BOOST_DECLARE_LOG(g_log_err, log_type)
-BOOST_DECLARE_LOG(g_log_app, log_type)
-BOOST_DECLARE_LOG(g_log_dbg, log_type)
+#include <boost/logging/format/named_writer.hpp>
+typedef boost::logging::named_logger<>::type logger_type;
 
 // Step 5: define the macros through which you'll log
 #define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_dbg(), g_log_level(), debug ) << "[dbg] "
 #define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_err(), g_log_level(), error )
 #define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_log_app(), g_log_level(), info ) << "[app] "
 
-
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_level, boost::logging::level::holder )
-BOOST_DEFINE_LOG(g_log_err, log_type)
-BOOST_DEFINE_LOG(g_log_app, log_type)
-BOOST_DEFINE_LOG(g_log_dbg, log_type)
+BOOST_DEFINE_LOG(g_log_err, logger_type)
+BOOST_DEFINE_LOG(g_log_app, logger_type)
+BOOST_DEFINE_LOG(g_log_dbg, logger_type)
 
 using namespace boost::logging;
 
 void mul_levels_mul_logers_example() {
- // Step 7: add formatters and destinations
- // That is, how the message is to be formatted and where should it be written to
-
- // Err log
- g_log_err()->writer().add_formatter( formatter::idx(), "[%] " );
- g_log_err()->writer().add_formatter( formatter::time("$hh:$mm.$ss ") );
- g_log_err()->writer().add_formatter( formatter::append_newline() );
- g_log_err()->writer().add_destination( destination::file("err.txt") );
-
+ // reuse the same destination for 2 logs
     destination::file out("out.txt");
- // App log
- g_log_app()->writer().add_formatter( formatter::time("$hh:$mm.$ss ") );
- g_log_app()->writer().add_formatter( formatter::append_newline() );
- g_log_app()->writer().add_destination( out );
- g_log_app()->writer().add_destination( destination::cout() );
-
- // Debug log
- g_log_dbg()->writer().add_formatter( formatter::time("$hh:$mm.$ss ") );
- g_log_dbg()->writer().add_formatter( formatter::append_newline() );
- g_log_dbg()->writer().add_destination( out );
- g_log_dbg()->writer().add_destination( destination::dbg_window() );
-
- g_log_app()->turn_cache_off();
- g_log_err()->turn_cache_off();
- g_log_dbg()->turn_cache_off();
+ g_log_app()->writer().replace_destination("file", out);
+ g_log_dbg()->writer().replace_destination("file", out);
+ // formatting (first param) and destinations (second param)
+ g_log_err()->writer().write("[%idx%] %time%($hh:$mm.$ss) |\n", "file(err.txt)");
+ g_log_app()->writer().write("%time%($hh:$mm.$ss) |\n", "file cout");
+ g_log_dbg()->writer().write("%time%($hh:$mm.$ss) |\n", "file cout debug");
+
+ g_log_app()->mark_as_initialized();
+ g_log_err()->mark_as_initialized();
+ g_log_dbg()->mark_as_initialized();
+
 
     // Step 8: use it...
     int i = 1;

Modified: sandbox/logging/lib/logging/samples/scenarios/mul_levels_one_logger.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/mul_levels_one_logger.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/mul_levels_one_logger.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -27,64 +27,35 @@
 */
 
 
+#include <boost/logging/format/named_writer.hpp>
+typedef boost::logging::named_logger<>::type logger_type;
 
-#include <boost/logging/format.hpp>
-//#include <boost/logging/format/formatter/high_precision_time.hpp>
-#include <boost/logging/format/destination/named.hpp>
-
-using namespace boost::logging;
-// Step 3 : Specify your logging class(es)
-typedef logger_format_write< > log_type;
-
-// Step 4: declare which filters and loggers you'll use (usually in a header file)
-BOOST_DECLARE_LOG_FILTER(g_log_level, level::holder )
-BOOST_DECLARE_LOG(g_l, log_type)
-
-// Step 5: define the macros through which you'll log
-#define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), debug )
-#define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), error )
-#define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), info )
-
-// Step 6: Define the filters and loggers you'll use (usually in a source file)
-BOOST_DEFINE_LOG_FILTER(g_log_level, level::holder ) // holds the application log level
-BOOST_DEFINE_LOG(g_l, log_type)
+#define L_(lvl) BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), lvl )
 
+BOOST_DEFINE_LOG_FILTER(g_log_level, boost::logging::level::holder ) // holds the application log level
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 void test_mul_levels_one_logger() {
- // Step 7: add formatters and destinations
- // That is, how the message is to be formatted...
- g_l()->writer().add_formatter( formatter::idx(), "[%] " );
- //g_l()->writer().add_formatter( formatter::high_precision_time("$hh:$mm:$ss.$mili ") );
- g_l()->writer().add_formatter( formatter::append_newline() );
-
- // ... and where should it be written to
- g_l()->writer().add_destination(
- destination::named("cout debug out")
- .add( "cout", destination::cout())
- .add( "out", destination::file("out.txt"))
- .add( "debug", destination::dbg_window() )
- );
+ // formatting (first param) and destinations (second param)
+ g_l()->writer().write("%time%($hh:$mm.$ss.$mili) [%idx%] |\n", "cout file(out.txt) debug");
+ g_l()->mark_as_initialized();
 
- g_l()->turn_cache_off();
-
- // Step 8: use it...
     int i = 1;
- LDBG_ << "this is so cool " << i++;
- LERR_ << "first error " << i++;
+ L_(debug) << "this is so cool " << i++;
+ L_(error) << "first error " << i++;
 
     std::string hello = "hello", world = "world";
- LAPP_ << hello << ", " << world;
+ L_(debug) << hello << ", " << world;
 
+ using namespace boost::logging;
     g_log_level()->set_enabled(level::error);
- LDBG_ << "this will not be written anywhere";
- LAPP_ << "this won't be written anywhere either";
- LERR_ << "second error " << i++;
+ L_(debug) << "this will not be written anywhere";
+ L_(info) << "this won't be written anywhere either";
+ L_(error) << "second error " << i++;
 
     g_log_level()->set_enabled(level::info);
- LAPP_ << "good to be back ;) " << i++;
- LERR_ << "third error " << i++;
-
- // Step 9 : Enjoy!
+ L_(info) << "good to be back ;) " << i++;
+ L_(error) << "third error " << i++;
 }
 
 

Modified: sandbox/logging/lib/logging/samples/scenarios/mul_loggers_one_filter.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/mul_loggers_one_filter.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/mul_loggers_one_filter.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -67,13 +67,13 @@
 using namespace boost::logging;
 
 // Step 3 : Specify your logging class(es)
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_log_err, log_type)
-BOOST_DECLARE_LOG(g_log_app, log_type)
-BOOST_DECLARE_LOG(g_log_dbg, log_type)
+BOOST_DECLARE_LOG(g_log_err, logger_type)
+BOOST_DECLARE_LOG(g_log_app, logger_type)
+BOOST_DECLARE_LOG(g_log_dbg, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define LDBG_ BOOST_LOG_USE_LOG_IF_FILTER(g_log_dbg(), g_log_filter()->is_enabled() ) << "[dbg] "
@@ -82,9 +82,9 @@
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_log_err, log_type)
-BOOST_DEFINE_LOG(g_log_app, log_type)
-BOOST_DEFINE_LOG(g_log_dbg, log_type)
+BOOST_DEFINE_LOG(g_log_err, logger_type)
+BOOST_DEFINE_LOG(g_log_app, logger_type)
+BOOST_DEFINE_LOG(g_log_dbg, logger_type)
 
 void mul_logger_one_filter_example() {
     // Step 7: add formatters and destinations

Modified: sandbox/logging/lib/logging/samples/scenarios/no_levels_with_route.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/no_levels_with_route.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/no_levels_with_route.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -62,18 +62,18 @@
 
 
 // Step 3 : Specify your logging class(es)
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 void no_levels_with_route_example() {
     // Step 7: add formatters and destinations

Modified: sandbox/logging/lib/logging/samples/scenarios/one_loger_one_filter.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/one_loger_one_filter.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/one_loger_one_filter.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -33,42 +33,23 @@
 
 #include <boost/logging/format_fwd.hpp>
 
-// Step 1: Optimize : use a cache string, to make formatting the message faster
+// Optimize : use a cache string, to make formatting the message faster
 BOOST_LOG_FORMAT_MSG( optimize::cache_string_one_str<> )
 
-#include <boost/logging/format.hpp>
+#include <boost/logging/format/named_writer.hpp>
+typedef boost::logging::named_logger<>::type logger_type;
 
-using namespace boost::logging;
-
-// Step 3 : Specify your logging class(es)
-typedef logger_format_write< > log_type;
-
-
-// Step 4: declare which filters and loggers you'll use (usually in a header file)
-BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
-
-// Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
-// Step 6: Define the filters and loggers you'll use (usually in a source file)
-BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+// Define the filters and loggers you'll use (usually in a source file)
+BOOST_DEFINE_LOG_FILTER(g_log_filter, boost::logging::filter::no_ts )
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 
 void one_logger_one_filter_example() {
- // Step 7: add formatters and destinations
- // That is, how the message is to be formatted and where should it be written to
+ g_l()->writer().write("[%idx%] |\n", "cout file(out.txt) debug");
+ g_l()->mark_as_initialized();
 
- g_l()->writer().add_formatter( formatter::idx(), "[%] " );
- g_l()->writer().add_formatter( formatter::append_newline_if_needed() );
- g_l()->writer().add_destination( destination::file("out.txt") );
- g_l()->writer().add_destination( destination::cout() );
- g_l()->writer().add_destination( destination::dbg_window() );
-
- g_l()->turn_cache_off();
-
- // Step 8: use it...
     int i = 1;
     L_ << "this is so cool " << i++;
     L_ << "this is so cool again " << i++;
@@ -82,8 +63,6 @@
 
     g_log_filter()->set_enabled(true);
     L_ << "good to be back ;) " << i++;
-
- // Step 9 : Enjoy!
 }
 
 

Modified: sandbox/logging/lib/logging/samples/scenarios/ts_loger_one_filter.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/ts_loger_one_filter.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/ts_loger_one_filter.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -59,19 +59,19 @@
 using namespace boost::logging;
 
 // Step 3 : Specify your logging class(es)
-typedef logger_format_write< default_, default_, writer::threading::ts_write > log_type;
+typedef logger_format_write< default_, default_, writer::threading::ts_write > logger_type;
 
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 void do_sleep(int ms) {
     using namespace boost;

Modified: sandbox/logging/lib/logging/samples/scenarios/use_profiler.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/use_profiler.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/use_profiler.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -67,7 +67,7 @@
 #else
 typedef bl::logger_format_write< > raw_log_type;
 #endif
-typedef bl::profile::compute_for_logger<raw_log_type>::type log_type;
+typedef bl::profile::compute_for_logger<raw_log_type>::type logger_type;
 
 typedef bl::profile::compute_for_filter<bl::filter::no_ts>::type filter_type;
 
@@ -80,7 +80,7 @@
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter_type )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 void do_sleep(int ms) {
     using namespace boost;

Modified: sandbox/logging/lib/logging/samples/scenarios/use_tss_ostringstream.cpp
==============================================================================
--- sandbox/logging/lib/logging/samples/scenarios/use_tss_ostringstream.cpp (original)
+++ sandbox/logging/lib/logging/samples/scenarios/use_tss_ostringstream.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -45,19 +45,19 @@
 using namespace boost::logging;
 
 // Step 3 : Specify your logging class(es)
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 
 
 // Step 4: declare which filters and loggers you'll use (usually in a header file)
 BOOST_DECLARE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DECLARE_LOG(g_l, log_type)
+BOOST_DECLARE_LOG(g_l, logger_type)
 
 // Step 5: define the macros through which you'll log
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )
 
 // Step 6: Define the filters and loggers you'll use (usually in a source file)
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 
 void use_tss_ostringstream_example() {

Modified: sandbox/logging/lib/logging/tests/test_after_destroyed/test.cpp
==============================================================================
--- sandbox/logging/lib/logging/tests/test_after_destroyed/test.cpp (original)
+++ sandbox/logging/lib/logging/tests/test_after_destroyed/test.cpp 2008-01-23 18:28:18 EST (Wed, 23 Jan 2008)
@@ -8,7 +8,7 @@
 
 using namespace boost::logging;
 
-typedef logger_format_write< > log_type;
+typedef logger_format_write< > logger_type;
 
 
 
@@ -34,7 +34,7 @@
 } s_before_log;
 
 BOOST_DEFINE_LOG_FILTER(g_log_filter, filter::no_ts )
-BOOST_DEFINE_LOG(g_l, log_type)
+BOOST_DEFINE_LOG(g_l, logger_type)
 
 
 #define L_ BOOST_LOG_USE_LOG_IF_FILTER(g_l(), g_log_filter()->is_enabled() )


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