1 #include "logging/FileAppender.hpp" 3 #include <rtt/Logger.hpp> 5 #include <log4cpp/FileAppender.hh> 12 FileAppender::FileAppender(std::string name) :
13 OCL::logging::Appender(name),
14 filename_prop(
"Filename",
"Name of file to log to"),
15 maxEventsPerCycle_prop(
"MaxEventsPerCycle",
"Maximum number of log events to pop per cycle",1),
18 properties()->addProperty(filename_prop);
19 properties()->addProperty(maxEventsPerCycle_prop);
22 FileAppender::~FileAppender()
26 bool FileAppender::configureHook()
29 int m = maxEventsPerCycle_prop.rvalue();
32 log(Error) <<
"Invalid maxEventsPerCycle value of " 33 << m <<
". Value must be >= 0." 37 maxEventsPerCycle = m;
43 appender =
new log4cpp::FileAppender(getName(), filename_prop.rvalue());
45 return configureLayout();
48 void FileAppender::updateHook()
50 processEvents(maxEventsPerCycle);
53 void FileAppender::cleanupHook()
This file contains the macros and definitions to create dynamically loadable components.
The Orocos Component Library.