log4cpp
1.1.6
Toggle main menu visibility
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
13
#include <
log4cpp/LayoutAppender.hh
>
14
#include <
log4cpp/Portability.hh
>
15
#include <queue>
16
#include <string>
17
18
namespace
log4cpp
{
19
26
class
LOG4CPP_EXPORT
StringQueueAppender
:
public
LayoutAppender
{
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
LOG4CPP_EXPORT
#define LOG4CPP_EXPORT
Definition
Export.hh:26
LayoutAppender.hh
Portability.hh
log4cpp::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition
LayoutAppender.cpp:15
log4cpp::StringQueueAppender::StringQueueAppender
StringQueueAppender(const std::string &name)
Definition
StringQueueAppender.cpp:15
log4cpp::StringQueueAppender::_append
virtual void _append(const LoggingEvent &event)
Appends the LoggingEvent to the queue.
Definition
StringQueueAppender.cpp:25
log4cpp::StringQueueAppender::popMessage
virtual std::string popMessage()
Pop the oldest log message from the front of the queue.
Definition
StringQueueAppender.cpp:45
log4cpp::StringQueueAppender::close
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Definition
StringQueueAppender.cpp:21
log4cpp::StringQueueAppender::getQueue
virtual std::queue< std::string > & getQueue()
Return the queue to which the Appends adds messages.
Definition
StringQueueAppender.cpp:33
log4cpp::StringQueueAppender::_queue
std::queue< std::string > _queue
Definition
StringQueueAppender.hh:66
log4cpp::StringQueueAppender::queueSize
virtual size_t queueSize() const
Return the current size of the message queue.
Definition
StringQueueAppender.cpp:41
log4cpp::StringQueueAppender::reopen
virtual bool reopen()
Reopens the output destination of this Appender, e.g.
Definition
StringQueueAppender.cpp:29
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
log4cpp::LoggingEvent
The internal representation of logging events.
Definition
LoggingEvent.hh:32
include
log4cpp
StringQueueAppender.hh
Generated by
1.17.0