#include <StringQueueAppender.hh>
Public Member Functions | |
virtual void | close () |
virtual std::queue< std::string > & | getQueue () |
virtual const std::queue< std::string > & | getQueue () const |
virtual std::string | popMessage () |
virtual size_t | queueSize () const |
virtual bool | reopen () |
StringQueueAppender (const std::string &name) | |
virtual | ~StringQueueAppender () |
Public Member Functions inherited from log4cpp::LayoutAppender | |
LayoutAppender (const std::string &name) | |
virtual bool | requiresLayout () const |
virtual void | setLayout (Layout *layout=NULL) |
virtual | ~LayoutAppender () |
Public Member Functions inherited from log4cpp::AppenderSkeleton | |
virtual void | doAppend (const LoggingEvent &event) |
virtual Filter * | getFilter () |
virtual Priority::Value | getThreshold () |
virtual void | setFilter (Filter *filter) |
virtual void | setThreshold (Priority::Value priority) |
virtual | ~AppenderSkeleton () |
Public Member Functions inherited from log4cpp::Appender | |
const std::string & | getName () const |
virtual | ~Appender () |
Protected Member Functions | |
virtual void | _append (const LoggingEvent &event) |
Protected Member Functions inherited from log4cpp::LayoutAppender | |
Layout & | _getLayout () |
Protected Member Functions inherited from log4cpp::AppenderSkeleton | |
AppenderSkeleton (const std::string &name) | |
Protected Member Functions inherited from log4cpp::Appender | |
Appender (const std::string &name) | |
Protected Attributes | |
std::queue< std::string > | _queue |
Additional Inherited Members | |
Public Types inherited from log4cpp::LayoutAppender | |
typedef BasicLayout | DefaultLayoutType |
Static Public Member Functions inherited from log4cpp::Appender | |
static void | closeAll () |
static Appender * | getAppender (const std::string &name) |
static bool | reopenAll () |
This class puts log messages in an in-memory queue. Its primary use is in test cases, but it may be useful elsewhere as well.
Definition at line 26 of file StringQueueAppender.hh.
log4cpp::StringQueueAppender::StringQueueAppender | ( | const std::string & | name | ) |
Definition at line 15 of file StringQueueAppender.cpp.
|
virtual |
Definition at line 19 of file StringQueueAppender.cpp.
|
protectedvirtual |
Appends the LoggingEvent to the queue.
event | the LoggingEvent to layout and append to the queue. |
Implements log4cpp::AppenderSkeleton.
Definition at line 27 of file StringQueueAppender.cpp.
|
virtual |
Release any resources allocated within the appender such as file handles, network connections, etc.
Implements log4cpp::AppenderSkeleton.
Definition at line 23 of file StringQueueAppender.cpp.
|
virtual |
Return the queue to which the Appends adds messages.
Definition at line 35 of file StringQueueAppender.cpp.
|
virtual |
Return the queue to which the Appends adds messages.
Definition at line 39 of file StringQueueAppender.cpp.
|
virtual |
Pop the oldest log message from the front of the queue.
Definition at line 47 of file StringQueueAppender.cpp.
|
virtual |
Return the current size of the message queue. Shorthand for getQueue().size().
Definition at line 43 of file StringQueueAppender.cpp.
|
virtual |
Reopens the output destination of this Appender, e.g. the logfile or TCP socket.
Reimplemented from log4cpp::AppenderSkeleton.
Definition at line 31 of file StringQueueAppender.cpp.
|
protected |
Definition at line 68 of file StringQueueAppender.hh.