log4cpp 1.1.6
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 _LOG4CPP_STRINGQUEUEAPPENDER_HH
11#define _LOG4CPP_STRINGQUEUEAPPENDER_HH
12
15#include <queue>
16#include <string>
17
18namespace log4cpp {
19
27 public:
28 StringQueueAppender(const std::string& name);
29 virtual ~StringQueueAppender();
30
31 virtual bool reopen();
32 virtual void close();
33
39 virtual size_t queueSize() const;
40
45 virtual std::queue<std::string>& getQueue();
46
51 virtual const std::queue<std::string>& getQueue() const;
52
57 virtual std::string popMessage();
58
59 protected:
64 virtual void _append(const LoggingEvent& event);
65
66 std::queue<std::string> _queue;
67 };
68} // namespace log4cpp
69
70#endif // _LOG4CPP_STRINGQUEUEAPPENDER_HH
#define LOG4CPP_EXPORT
Definition Export.hh:26
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
StringQueueAppender(const std::string &name)
Definition StringQueueAppender.cpp:15
virtual void _append(const LoggingEvent &event)
Appends the LoggingEvent to the queue.
Definition StringQueueAppender.cpp:25
virtual std::string popMessage()
Pop the oldest log message from the front of the queue.
Definition StringQueueAppender.cpp:45
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Definition StringQueueAppender.cpp:21
virtual std::queue< std::string > & getQueue()
Return the queue to which the Appends adds messages.
Definition StringQueueAppender.cpp:33
std::queue< std::string > _queue
Definition StringQueueAppender.hh:66
virtual size_t queueSize() const
Return the current size of the message queue.
Definition StringQueueAppender.cpp:41
virtual bool reopen()
Reopens the output destination of this Appender, e.g.
Definition StringQueueAppender.cpp:29
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