OrocosComponentLibrary  2.8.3
Appender.hpp
1 #ifndef APPENDER_HPP
2 #define APPENDER_HPP 1
3 
4 #include <rtt/TaskContext.hpp>
5 #include <rtt/Port.hpp>
6 #include "LoggingEvent.hpp"
7 
8 // forward declare
9 namespace log4cpp {
10 class Appender;
11 }
12 
13 namespace OCL {
14 namespace logging {
15 
16 class Appender : public RTT::TaskContext
17 {
18 public:
19  Appender(std::string name);
20  virtual ~Appender();
21 
27  virtual bool configureLayout();
29  virtual bool startHook();
31  virtual void stopHook();
32 
35  virtual void drainBuffer();
36 
37 protected:
43  virtual void processEvents(int n);
44 
47  RTT::InputPort<OCL::logging::LoggingEvent> log_port;
48 
50  log4cpp::Appender* appender;
51 
52  // support layouts for all appenders
54  RTT::Property<std::string> layoutName_prop;
56  RTT::Property<std::string> layoutPattern_prop;
57 
58  // diagnostic: count number of times popped max events
59  unsigned int countMaxPopped;
60 };
61 
62 // namespaces
63 }
64 }
65 
66 #endif
RTT::Property< std::string > layoutName_prop
Layout name (e.g. "simple", "basic", "pattern")
Definition: Appender.hpp:54
RTT::InputPort< OCL::logging::LoggingEvent > log_port
Port we receive logging events on Initially unconnected.
Definition: Appender.hpp:47
log4cpp::Appender * appender
Appender created by derived class.
Definition: Appender.hpp:50
The Orocos Component Library.
Definition: Component.hpp:43
RTT::Property< std::string > layoutPattern_prop
Layout conversion pattern (for those layouts that use a pattern)
Definition: Appender.hpp:56