Loading...
Searching...
No Matches
StringQueueAppender.hh
Go to the documentation of this file.
/*
* StringQueueAppender.hh
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_STRINGQUEUEAPPENDER_HH
#define _LOG4SHIB_STRINGQUEUEAPPENDER_HH
#include <log4shib/Portability.hh>
#include <string>
#include <queue>
#include <log4shib/LayoutAppender.hh>
namespace log4shib {
class LOG4SHIB_EXPORT StringQueueAppender : public LayoutAppender {
public:
StringQueueAppender(const std::string& name);
virtual ~StringQueueAppender();
virtual bool reopen();
virtual void close();
virtual size_t queueSize() const;
virtual std::queue<std::string>& getQueue();
virtual const std::queue<std::string>& getQueue() const;
virtual std::string popMessage();
protected:
virtual void _append(const LoggingEvent& event);
std::queue<std::string> _queue;
};
}
#endif // _LOG4SHIB_STRINGQUEUEAPPENDER_HH
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
LayoutAppender.hh
Portability.hh
log4shib::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
log4shib::StringQueueAppender::queueSize
virtual size_t queueSize() const
Return the current size of the message queue.
Definition StringQueueAppender.cpp:43
log4shib::StringQueueAppender::popMessage
virtual std::string popMessage()
Pop the oldest log message from the front of the queue.
Definition StringQueueAppender.cpp:47
log4shib::StringQueueAppender::_append
virtual void _append(const LoggingEvent &event)
Appends the LoggingEvent to the queue.
Definition StringQueueAppender.cpp:27
log4shib::StringQueueAppender::getQueue
virtual std::queue< std::string > & getQueue()
Return the queue to which the Appends adds messages.
Definition StringQueueAppender.cpp:35
log4shib::StringQueueAppender::close
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Definition StringQueueAppender.cpp:23
log4shib::StringQueueAppender::StringQueueAppender
StringQueueAppender(const std::string &name)
Definition StringQueueAppender.cpp:15
log4shib::StringQueueAppender::reopen
virtual bool reopen()
Reopens the output destination of this Appender, e.g.
Definition StringQueueAppender.cpp:31
log4shib::StringQueueAppender::_queue
std::queue< std::string > _queue
Definition StringQueueAppender.hh:68
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
log4shib::LoggingEvent
The internal representation of logging events.
Definition LoggingEvent.hh:32