Apache log4cxx  Version 0.12.0
appender.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_APPENDER_H
19 #define _LOG4CXX_APPENDER_H
20 
21 #if defined(_MSC_VER)
22  #pragma warning ( push )
23  #pragma warning ( disable: 4231 4251 4275 4786 )
24 #endif
25 
26 
28 #include <log4cxx/helpers/object.h>
29 #include <vector>
30 
31 
32 namespace log4cxx
33 {
34 // Forward declarations
35 namespace spi
36 {
38 typedef std::shared_ptr<LoggingEvent> LoggingEventPtr;
39 
40 class Filter;
41 typedef std::shared_ptr<Filter> FilterPtr;
42 
44 typedef std::shared_ptr<ErrorHandler> ErrorHandlerPtr;
45 }
46 
47 class Layout;
48 typedef std::shared_ptr<Layout> LayoutPtr;
49 
50 
55 class LOG4CXX_EXPORT Appender :
56  public virtual spi::OptionHandler
57 {
58  public:
60 
61  virtual ~Appender() {}
62 
63  void asdf();
64 
68  virtual void addFilter(const spi::FilterPtr& newFilter) = 0;
69 
76  virtual spi::FilterPtr getFilter() const = 0;
77 
81  virtual void clearFilters() = 0;
82 
88  virtual void close() = 0;
89 
95  virtual void doAppend(const spi::LoggingEventPtr& event,
96  log4cxx::helpers::Pool& pool) = 0;
97 
98 
103  virtual LogString getName() const = 0;
104 
105 
109  virtual void setLayout(const LayoutPtr& layout) = 0;
110 
114  virtual LayoutPtr getLayout() const = 0;
115 
116 
121  virtual void setName(const LogString& name) = 0;
122 
137  virtual bool requiresLayout() const = 0;
138 };
139 
141 LOG4CXX_LIST_DEF(AppenderList, AppenderPtr);
142 
143 }
144 
145 #if defined(_MSC_VER)
146  #pragma warning ( pop )
147 #endif
148 
149 #endif //_LOG4CXX_APPENDER_H
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:26
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition: appender.h:37
The internal representation of logging events.
Definition: loggingevent.h:53
Extend this abstract class to create your own log layout format.
Definition: layout.h:37
std::shared_ptr< Layout > LayoutPtr
Definition: appender.h:47
std::shared_ptr< Appender > AppenderPtr
Definition: basicconfigurator.h:28
Implement this interface for your own strategies for outputting log statements.
Definition: appender.h:55
LOG4CXX_LIST_DEF(HierarchyEventListenerList, HierarchyEventListenerPtr)
std::shared_ptr< ErrorHandler > ErrorHandlerPtr
Definition: appender.h:43
Definition: pool.h:32
std::shared_ptr< Filter > FilterPtr
Definition: appender.h:40
A string based interface to configure package components.
Definition: optionhandler.h:34
LOG4CXX_PTR_DEF(LoggerRepository)
Appenders may delegate their error handling to ErrorHandlers.
Definition: errorhandler.h:64
Definition: appender.h:32
std::basic_string< logchar > LogString
Definition: logstring.h:66
Users should extend this class to implement customized logging event filtering.
Definition: filter.h:68