diff --git a/doc/core.qbk b/doc/core.qbk index a5807eb..c3caf7b 100644 --- a/doc/core.qbk +++ b/doc/core.qbk @@ -132,7 +132,7 @@ After global filtering is applied, log sinks step into action. In order to add a boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, logging::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); typedef sinks::unlocked_sink< sinks::text_ostream_backend > sink_t; boost::shared_ptr< sink_t > sink = boost::make_shared< sink_t >(backend); diff --git a/doc/tutorial.qbk b/doc/tutorial.qbk index 4407e66..15a6cd5 100644 --- a/doc/tutorial.qbk +++ b/doc/tutorial.qbk @@ -87,10 +87,10 @@ The [link log.detailed.sink_frontends.sync `synchronous_sink`] class template ab The [link log.detailed.sink_backends.text_ostream `text_ostream_backend`] class writes formatted log records into STL-compatible streams. We have used a file stream above but we could have used any type of stream. For example, adding output to console could look as follows: - #include <``[boost_log_utility_empty_deleter_hpp]``> + #include // We have to provide an empty deleter to avoid destroying the global stream object - boost::shared_ptr< std::ostream > stream(&std::clog, logging::empty_deleter()); + boost::shared_ptr< std::ostream > stream(&std::clog, boost::null_deleter()); sink->locked_backend()->add_stream(stream); The [link log.detailed.sink_backends.text_ostream `text_ostream_backend`] supports adding several streams. In that case its output will be duplicated to all added streams. It can be useful to duplicate the output to console and file since all the filtering, formatting and other overhead of the library happen only once per record for the sink. diff --git a/example/advanced_usage/main.cpp b/example/advanced_usage/main.cpp index 1e2f206..89448f2 100644 --- a/example/advanced_usage/main.cpp +++ b/example/advanced_usage/main.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) // interference of other threads that might be trying to log. // Next we add streams to which logging records should be output - shared_ptr< std::ostream > pStream(&std::clog, boost::empty_deleter()); + shared_ptr< std::ostream > pStream(&std::clog, boost::null_deleter()); pBackend->add_stream(pStream); // We can add more than one stream to the sink backend diff --git a/example/doc/extension_system_uptime_attr.cpp b/example/doc/extension_system_uptime_attr.cpp index f33fdb0..7b0cd9b 100644 --- a/example/doc/extension_system_uptime_attr.cpp +++ b/example/doc/extension_system_uptime_attr.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -85,7 +85,7 @@ void init_logging() // Initialize the sink typedef sinks::synchronous_sink< sinks::text_ostream_backend > sink_t; boost::shared_ptr< sink_t > sink(new sink_t()); - sink->locked_backend()->add_stream(boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + sink->locked_backend()->add_stream(boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); sink->set_formatter(expr::stream << expr::attr< unsigned int >("SystemUptime") << ": " << expr::smessage); core->add_sink(sink); //-> diff --git a/example/doc/sinks_async.cpp b/example/doc/sinks_async.cpp index c1804cc..3cc4fb6 100644 --- a/example/doc/sinks_async.cpp +++ b/example/doc/sinks_async.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/example/doc/sinks_async_bounded.cpp b/example/doc/sinks_async_bounded.cpp index a7cbbec..a0a7afe 100644 --- a/example/doc/sinks_async_bounded.cpp +++ b/example/doc/sinks_async_bounded.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/example/doc/sinks_async_ordering.cpp b/example/doc/sinks_async_ordering.cpp index 17d1204..96549b0 100644 --- a/example/doc/sinks_async_ordering.cpp +++ b/example/doc/sinks_async_ordering.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ boost::shared_ptr< sink_t > init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t( diff --git a/example/doc/sinks_ostream.cpp b/example/doc/sinks_ostream.cpp index 55b2f04..75d173e 100644 --- a/example/doc/sinks_ostream.cpp +++ b/example/doc/sinks_ostream.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,7 +30,7 @@ void init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); backend->add_stream( boost::shared_ptr< std::ostream >(new std::ofstream("sample.log"))); diff --git a/example/doc/sinks_sync.cpp b/example/doc/sinks_sync.cpp index cb269bf..5ba35d0 100644 --- a/example/doc/sinks_sync.cpp +++ b/example/doc/sinks_sync.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ void init_logging() boost::shared_ptr< sinks::text_ostream_backend > backend = boost::make_shared< sinks::text_ostream_backend >(); backend->add_stream( - boost::shared_ptr< std::ostream >(&std::clog, boost::empty_deleter())); + boost::shared_ptr< std::ostream >(&std::clog, boost::null_deleter())); // Wrap it into the frontend and register in the core boost::shared_ptr< sink_t > sink(new sink_t(backend)); diff --git a/include/boost/log/utility/empty_deleter.hpp b/include/boost/log/utility/empty_deleter.hpp index e415f04..67e5abc 100644 --- a/include/boost/log/utility/empty_deleter.hpp +++ b/include/boost/log/utility/empty_deleter.hpp @@ -16,7 +16,7 @@ #ifndef BOOST_LOG_UTILITY_EMPTY_DELETER_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_EMPTY_DELETER_HPP_INCLUDED_ -#include +#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -24,16 +24,16 @@ #endif #if defined(__GNUC__) -#pragma message "Boost.Log: This header is deprecated, use boost/utility/empty_deleter.hpp instead." +#pragma message "Boost.Log: This header is deprecated, use boost/core/null_deleter.hpp instead." #elif defined(_MSC_VER) -#pragma message("Boost.Log: This header is deprecated, use boost/utility/empty_deleter.hpp instead.") +#pragma message("Boost.Log: This header is deprecated, use boost/core/null_deleter.hpp instead.") #endif namespace boost { BOOST_LOG_OPEN_NAMESPACE -using boost::empty_deleter; +typedef boost::null_deleter empty_deleter; BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/include/boost/log/utility/setup/console.hpp b/include/boost/log/utility/setup/console.hpp index abd2db8..fadde4e 100644 --- a/include/boost/log/utility/setup/console.hpp +++ b/include/boost/log/utility/setup/console.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #ifndef BOOST_LOG_NO_THREADS @@ -59,7 +59,7 @@ shared_ptr< > > add_console_log(std::basic_ostream< CharT >& strm, ArgsT const& args) { - shared_ptr< std::basic_ostream< CharT > > pStream(&strm, boost::empty_deleter()); + shared_ptr< std::basic_ostream< CharT > > pStream(&strm, boost::null_deleter()); typedef sinks::basic_text_ostream_backend< CharT > backend_t; shared_ptr< backend_t > pBackend = boost::make_shared< backend_t >(); diff --git a/src/init_from_settings.cpp b/src/init_from_settings.cpp index 0130e7b..259f095 100644 --- a/src/init_from_settings.cpp +++ b/src/init_from_settings.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -309,7 +309,7 @@ private: typedef boost::log::aux::char_constants< BackendCharT > constants; typedef sinks::basic_text_ostream_backend< BackendCharT > backend_t; shared_ptr< backend_t > backend = boost::make_shared< backend_t >(); - backend->add_stream(shared_ptr< typename backend_t::stream_type >(&constants::get_console_log_stream(), boost::empty_deleter())); + backend->add_stream(shared_ptr< typename backend_t::stream_type >(&constants::get_console_log_stream(), boost::null_deleter())); // Auto flush if (optional< string_type > auto_flush_param = params["AutoFlush"])