11 #include <log4cplus/loglevel.h>
12 #include <log4cplus/version.h>
13 #include <boost/scoped_ptr.hpp>
35 BufferAppender::flushStdout() {
42 LogEventList::const_iterator it;
43 for (it = stored_.begin(); it != stored_.end(); ++it) {
44 const std::string level(it->first);
46 std::printf(
"%s [%s]: %s\n", level.c_str(),
47 event->getLoggerName().c_str(),
48 event->getMessage().c_str());
56 stored_.swap(stored_copy);
58 LogEventList::const_iterator it;
59 for (it = stored_copy.begin(); it != stored_copy.end(); ++it) {
62 log4cplus::Logger::getInstance(event->getLoggerName());
64 logger.log(event->getLogLevel(), event->getMessage());
71 return (stored_.size());
78 "Internal log buffer has been flushed already");
81 #if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0)
82 std::auto_ptr<log4cplus::spi::InternalLoggingEvent>
84 std::unique_ptr<log4cplus::spi::InternalLoggingEvent>
86 event_aptr =
event.clone();
90 log4cplus::LogLevelManager().toString(event.getLogLevel()),