From: Jelte Jansen Date: Fri, 7 Dec 2012 08:58:56 +0000 (+0100) Subject: [2445] Rename log_buffer and its namespace X-Git-Tag: bind10-1.0.0-beta-release~19^2~17^2~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfebd6128b4088ba489080cea7c53f141dce90ab;p=thirdparty%2Fkea.git [2445] Rename log_buffer and its namespace To prevent accidental outside use, all LogBugger (and BufferAppender) code is in the namespace isc::log::internal now, and the files have been renamed to _impl --- diff --git a/src/lib/log/Makefile.am b/src/lib/log/Makefile.am index 4a621cbe04..e9074f8198 100644 --- a/src/lib/log/Makefile.am +++ b/src/lib/log/Makefile.am @@ -31,7 +31,7 @@ libb10_log_la_SOURCES += message_initializer.cc message_initializer.h libb10_log_la_SOURCES += message_reader.cc message_reader.h libb10_log_la_SOURCES += message_types.h libb10_log_la_SOURCES += output_option.cc output_option.h -libb10_log_la_SOURCES += log_buffer.cc log_buffer.h +libb10_log_la_SOURCES += log_buffer_impl.cc log_buffer_impl.h EXTRA_DIST = README EXTRA_DIST += logimpl_messages.mes diff --git a/src/lib/log/log_buffer.cc b/src/lib/log/log_buffer_impl.cc similarity index 97% rename from src/lib/log/log_buffer.cc rename to src/lib/log/log_buffer_impl.cc index 5c29d20baa..837d9f3e7a 100644 --- a/src/lib/log/log_buffer.cc +++ b/src/lib/log/log_buffer_impl.cc @@ -12,14 +12,15 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include -#include +#include +#include #include #include namespace isc { namespace log { +namespace internal { LogBuffer& getLogBuffer() { static boost::scoped_ptr log_buffer(NULL); @@ -100,5 +101,6 @@ BufferAppender::append(const log4cplus::spi::InternalLoggingEvent& event) { buffer_.add(event); } +} // end namespace internal } // end namespace log } // end namespace isc diff --git a/src/lib/log/log_buffer.h b/src/lib/log/log_buffer_impl.h similarity index 98% rename from src/lib/log/log_buffer.h rename to src/lib/log/log_buffer_impl.h index 9e41533a63..887b210d3a 100644 --- a/src/lib/log/log_buffer.h +++ b/src/lib/log/log_buffer_impl.h @@ -23,6 +23,7 @@ namespace isc { namespace log { +namespace internal { /// \brief Buffer add after flush /// @@ -126,6 +127,7 @@ private: /// \brief Getter for the singleton instance of the log buffer LogBuffer& getLogBuffer(); +} // end namespace internal } // end namespace log } // end namespace isc diff --git a/src/lib/log/logger_manager_impl.cc b/src/lib/log/logger_manager_impl.cc index f67116dda0..9a7ba29f31 100644 --- a/src/lib/log/logger_manager_impl.cc +++ b/src/lib/log/logger_manager_impl.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include using namespace std; @@ -51,7 +51,7 @@ LoggerManagerImpl::processInit() { // Flush the LogBuffer at the end of processing a new specification void LoggerManagerImpl::processEnd() { - getLogBuffer().flush(); + internal::getLogBuffer().flush(); } // Process logging specification. Set up the common states then dispatch to @@ -141,7 +141,8 @@ LoggerManagerImpl::createFileAppender(log4cplus::Logger& logger, void LoggerManagerImpl::createBufferAppender(log4cplus::Logger& logger) { - log4cplus::SharedAppenderPtr bufferapp(new BufferAppender(getLogBuffer())); + log4cplus::SharedAppenderPtr bufferapp( + new internal::BufferAppender(internal::getLogBuffer())); bufferapp->setName("buffer"); logger.addAppender(bufferapp); // Since we do not know at what level the loggers will end up diff --git a/src/lib/log/tests/log_buffer_unittest.cc b/src/lib/log/tests/log_buffer_unittest.cc index 0d6da8f7f9..4fbe75fe68 100644 --- a/src/lib/log/tests/log_buffer_unittest.cc +++ b/src/lib/log/tests/log_buffer_unittest.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -26,6 +26,7 @@ #include using namespace isc::log; +using namespace isc::log::internal; namespace isc { namespace log {