-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAppenderSkeleton.cpp
More file actions
60 lines (47 loc) · 1.41 KB
/
AppenderSkeleton.cpp
File metadata and controls
60 lines (47 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* AppenderSkeleton.cpp
*
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2001, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include "PortabilityImpl.hh"
#include <log4cpp/AppenderSkeleton.hh>
namespace log4cpp {
AppenderSkeleton::AppenderSkeleton(const std::string& name) :
Appender(name),
_threshold(Priority::NOTSET),
_filter(NULL) {
}
AppenderSkeleton::~AppenderSkeleton() {
if (_filter)
delete _filter;
}
bool AppenderSkeleton::reopen() {
return true;
}
void AppenderSkeleton::doAppend(const LoggingEvent& event) {
if ((Priority::NOTSET == _threshold) || (event.priority <= _threshold)) {
if (!_filter || (_filter->decide(event) != Filter::DENY)) {
_append(event);
}
}
}
void AppenderSkeleton::setThreshold(Priority::Value priority) {
_threshold = priority;
}
Priority::Value AppenderSkeleton::getThreshold() {
return _threshold;
}
void AppenderSkeleton::setFilter(Filter* filter) {
if (_filter != filter) {
if (_filter)
delete _filter;
_filter = filter;
}
}
Filter* AppenderSkeleton::getFilter() {
return _filter;
}
}