Appender.hh
Go to the documentation of this file.
1 /*
2  * Appender.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_APPENDER_HH
11 #define _LOG4CPP_APPENDER_HH
12 
13 #include <log4cpp/Portability.hh>
14 #include <string>
15 #include <map>
16 #include <set>
17 #include <stdarg.h>
18 #include <sys/types.h>
19 #include <sys/stat.h>
20 #include <fcntl.h>
21 #include <log4cpp/Priority.hh>
22 #include <log4cpp/Layout.hh>
23 #include <log4cpp/LoggingEvent.hh>
25 
28 
34 public:
35 
36  // helps cleaning up
37  friend class HierarchyMaintainer;
38 
45  static Appender* getAppender(const std::string& name);
46 
51  static bool reopenAll();
52 
57  static void closeAll();
58 
59 protected:
65  Appender(const std::string& name);
66 
67 public:
71  virtual ~Appender();
72 
77  virtual void doAppend(const LoggingEvent& event) = 0;
78 
84  virtual bool reopen() = 0;
85 
90  virtual void close() = 0;
91 
97  virtual bool requiresLayout() const = 0;
98 
103  virtual void setLayout(Layout* layout) = 0;
104 
109  inline const std::string& getName() const { return _name; };
110 
117  virtual void setThreshold(Priority::Value priority) = 0;
118 
123  virtual Priority::Value getThreshold() = 0;
124 
128  virtual void setFilter(Filter* filter) = 0;
129 
134  virtual Filter* getFilter() = 0;
135 
136 private:
137  typedef std::map<std::string, Appender*> AppenderMap;
138 
139  static AppenderMap* _allAppenders;
141 
142  static AppenderMap& _getAllAppenders();
143  static void _deleteAllAppenders();
144  static void _addAppender(Appender* appender);
145  static void _removeAppender(Appender* appender);
146 
147  const std::string _name;
148 private:
149  // suppress assignment operator
150  Appender & operator=(const Appender &);
151 };
152 
153 typedef std::set<Appender *> AppenderSet;
155 
156 #endif // _LOG4CPP_APPENDER_HH
#define LOG4CPP_NS_END
Definition: Portability.hh:50
static threading::Mutex _appenderMapMutex
Definition: Appender.hh:140
HierarchyMaintainer is an internal log4cpp class.
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
The top level namespace for all &#39;Log for C++&#39; types and classes.
Definition: LoggingEvent.hh:32
Users should extend this class to implement customized logging event filtering.
Definition: Filter.hh:49
std::map< std::string, Appender * > AppenderMap
Definition: Appender.hh:137
#define LOG4CPP_EXPORT
Definition: Export.hh:21
const std::string & getName() const
Get the name of this appender.
Definition: Appender.hh:109
static AppenderMap * _allAppenders
Definition: Appender.hh:139
std::set< Appender * > AppenderSet
Definition: Appender.hh:153
Extend this abstract class to create your own log layout format.
Definition: Layout.hh:22
const std::string _name
Definition: Appender.hh:147
int Value
The type of Priority Values.
Definition: Priority.hh:87
Implement this interface for your own strategies for printing log statements.
Definition: Appender.hh:33
#define LOG4CPP_NS_BEGIN
Definition: Portability.hh:49


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:53