log4cpp
1.1.6
Toggle main menu visibility
Loading...
Searching...
No Matches
BufferingAppender.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
3
* Copyright 2002, Bastiaan Bakker. All rights reserved.
4
*
5
* See the COPYING file for the terms of usage and distribution.
6
*/
7
8
#if !defined(h_ebd0ee89_622d_4af1_9a9d_d0e057debe86)
9
#define h_ebd0ee89_622d_4af1_9a9d_d0e057debe86
10
11
#include <list>
12
#include <
log4cpp/LayoutAppender.hh
>
13
#include <
log4cpp/TriggeringEventEvaluator.hh
>
14
#include <memory>
15
16
namespace
log4cpp
{
17
class
LOG4CPP_EXPORT
BufferingAppender
:
public
LayoutAppender
{
18
public
:
19
BufferingAppender
(
const
std::string name,
unsigned
long
max_size, std::LOG4CPP_UNIQUE_PTR<Appender> sink,
20
std::LOG4CPP_UNIQUE_PTR<TriggeringEventEvaluator> evaluator);
21
22
virtual
void
close
() {
23
sink_->close();
24
}
25
26
bool
getLossy
()
const
{
27
return
lossy_;
28
}
29
void
setLossy
(
bool
lossy) {
30
lossy_ = lossy;
31
}
32
33
protected
:
34
virtual
void
_append(
const
LoggingEvent
& event);
35
36
private
:
37
typedef
std::list<LoggingEvent> queue_t;
38
39
queue_t queue_;
40
unsigned
long
max_size_;
41
std::LOG4CPP_UNIQUE_PTR<Appender> sink_;
42
std::LOG4CPP_UNIQUE_PTR<TriggeringEventEvaluator> evaluator_;
43
bool
lossy_;
44
45
void
dump();
46
};
47
}
// namespace log4cpp
48
49
#endif
// h_ebd0ee89_622d_4af1_9a9d_d0e057debe86
LOG4CPP_EXPORT
#define LOG4CPP_EXPORT
Definition
Export.hh:26
LayoutAppender.hh
TriggeringEventEvaluator.hh
log4cpp::BufferingAppender::getLossy
bool getLossy() const
Definition
BufferingAppender.hh:26
log4cpp::BufferingAppender::setLossy
void setLossy(bool lossy)
Definition
BufferingAppender.hh:29
log4cpp::BufferingAppender::BufferingAppender
BufferingAppender(const std::string name, unsigned long max_size, std::LOG4CPP_UNIQUE_PTR< Appender > sink, std::LOG4CPP_UNIQUE_PTR< TriggeringEventEvaluator > evaluator)
Definition
BufferingAppender.cpp:14
log4cpp::BufferingAppender::close
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Definition
BufferingAppender.hh:22
log4cpp::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition
LayoutAppender.cpp:15
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
BufferingAppender.hh
Generated by
1.17.0