Commit dfebd612 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[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
parent 231bfc60
......@@ -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
......
......@@ -12,14 +12,15 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <log/log_buffer.h>
#include <log4cplus/loglevel.h>
#include <log/log_buffer_impl.h>
#include <log4cplus/loglevel.h>
#include <boost/scoped_ptr.hpp>
#include <iostream>
namespace isc {
namespace log {
namespace internal {
LogBuffer& getLogBuffer() {
static boost::scoped_ptr<LogBuffer> 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
......@@ -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
......
......@@ -30,7 +30,7 @@
#include <log/log_messages.h>
#include <log/logger_name.h>
#include <log/logger_specification.h>
#include <log/log_buffer.h>
#include <log/log_buffer_impl.h>
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
......
......@@ -18,7 +18,7 @@
#include <log/macros.h>
#include <log/logger_support.h>
#include <log/log_messages.h>
#include <log/log_buffer.h>
#include <log/log_buffer_impl.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/logger.h>
......@@ -26,6 +26,7 @@
#include <log4cplus/spi/loggingevent.h>
using namespace isc::log;
using namespace isc::log::internal;
namespace isc {
namespace log {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment