log4cpp  1.1.6
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 
14 #include <log4cpp/Portability.hh>
15 #include <queue>
16 #include <string>
17 
18 namespace 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
This class puts log messages in an in-memory queue.
Definition: StringQueueAppender.hh:26
#define LOG4CPP_EXPORT
Definition: Export.hh:26
The top level namespace for all &#39;Log for C++&#39; types and classes.
Definition: AbortAppender.hh:16
The internal representation of logging events.
Definition: LoggingEvent.hh:32
std::queue< std::string > _queue
Definition: StringQueueAppender.hh:66
LayoutAppender is a common superclass for all Appenders that require a Layout.
Definition: LayoutAppender.hh:24