log4shib 2.0.1
Loading...
Searching...
No Matches
StringQueueAppender.hh
Go to the documentation of this file.
1/*
2 * StringQueueAppender.hh
3 *
4 * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5 * Copyright 2000, Bastiaan Bakker. All rights reserved.
6 *
7 * See the COPYING file for the terms of usage and distribution.
8 */
9
10#ifndef _LOG4SHIB_STRINGQUEUEAPPENDER_HH
11#define _LOG4SHIB_STRINGQUEUEAPPENDER_HH
12
14#include <string>
15#include <queue>
17
18namespace log4shib {
19
27 public:
28
29 StringQueueAppender(const std::string& name);
30 virtual ~StringQueueAppender();
31
32 virtual bool reopen();
33 virtual void close();
34
40 virtual size_t queueSize() const;
41
46 virtual std::queue<std::string>& getQueue();
47
52 virtual const std::queue<std::string>& getQueue() const;
53
58 virtual std::string popMessage();
59
60 protected:
61
66 virtual void _append(const LoggingEvent& event);
67
68 std::queue<std::string> _queue;
69 };
70}
71
72#endif // _LOG4SHIB_STRINGQUEUEAPPENDER_HH
#define LOG4SHIB_EXPORT
Definition Export.hh:11
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
virtual size_t queueSize() const
Return the current size of the message queue.
Definition StringQueueAppender.cpp:43
virtual std::string popMessage()
Pop the oldest log message from the front of the queue.
Definition StringQueueAppender.cpp:47
virtual void _append(const LoggingEvent &event)
Appends the LoggingEvent to the queue.
Definition StringQueueAppender.cpp:27
virtual std::queue< std::string > & getQueue()
Return the queue to which the Appends adds messages.
Definition StringQueueAppender.cpp:35
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Definition StringQueueAppender.cpp:23
StringQueueAppender(const std::string &name)
Definition StringQueueAppender.cpp:15
virtual bool reopen()
Reopens the output destination of this Appender, e.g.
Definition StringQueueAppender.cpp:31
std::queue< std::string > _queue
Definition StringQueueAppender.hh:68
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
The internal representation of logging events.
Definition LoggingEvent.hh:32