Jafar
|
This object logs data in a single log file. More...
This object logs data in a single log file.
Definition at line 151 of file dataLog.hpp.
#include <dataLog.hpp>
Public Member Functions | |
DataLogger (std::string const &logFilename_, char separator_= '\t', char commentPrefix_= '#') | |
void | setLoggerTask (LoggerTask *loggerTask) |
setting a logger task defers actual file write to a separate thread | |
void | writeComment (std::string const &comment_) |
write comment_ | |
void | writeCurrentDate () |
write current date as a comment | |
void | addLoggable (DataLoggable &loggable_) |
add loggable_ to be logged by this logger. The log header is printed at this moment, so you should use this function when all objects have been created. | |
void | removeLoggable (DataLoggable const &loggable_) |
remove loggable_ | |
void | addSlaveLogger (DataLogger &logger_) |
Add slave logger_. | |
void | log () |
this method triggers a log. | |
void | logStats () |
this method triggers a log of stats. | |
void | writeLegend (std::string const &legend_) |
This method writes a line of legend. | |
void | writeLegendTokens (std::string const &legendTokens_, std::string const &tokenSep_=" ") |
This method writes lines of legend based on the tokens found in legendTokens_ and seperated by separator_. | |
template<typename T > | |
void | writeData (T const &d) |
this method logs any data | |
void | writeNewLine () |
void | writeNaN () |
write a NaN to the log | |
template<class Vec > | |
void | writeDataVector (Vec const &v) |
this method logs any data vector | |
Private Types | |
typedef std::list < DataLoggable const * > | LoggablesList |
typedef std::list< DataLogger * > | LoggersList |
Private Member Functions | |
void | write (std::ostringstream &content) |
Private Attributes | |
std::ofstream | logStream |
std::ostringstream | logHeaderLine |
std::ostringstream | logContent |
bool | logStarted |
char | separator |
default separator is whitespace | |
char | commentPrefix |
default comment prefix is '# ' | |
unsigned int | nbColumns |
LoggerTask * | loggerTask |
LoggablesList | loggables |
LoggersList | slaves |
jafar::kernel::DataLogger::DataLogger | ( | std::string const & | logFilename_, |
char | separator_ = '\t' , |
||
char | commentPrefix_ = '#' |
||
) |
logFilename_ | filename of the data log. |
separator_ | string used to separate the data |
commentPrefix_ | string which starts a comment line |
void jafar::kernel::DataLogger::addSlaveLogger | ( | DataLogger & | logger_ | ) |
Add slave logger_.
log() events are dispatched to the slaves.
void jafar::kernel::DataLogger::writeLegend | ( | std::string const & | legend_ | ) |
This method writes a line of legend.
Example:
log.writeLegend("x");
Referenced by jafar::simu::RobotPoseAnalysis::writeLogHeader().
void jafar::kernel::DataLogger::writeLegendTokens | ( | std::string const & | legendTokens_, |
std::string const & | tokenSep_ = " " |
||
) |
This method writes lines of legend based on the tokens found in legendTokens_ and seperated by separator_.
It uses boost::tokenizer. Example:
log.writeLegendTokens("x y z");
Referenced by jafar::simu::RobotPoseAnalysis::writeLogHeader(), jafar::rtslam::simu::MobileObject::writeLogHeader(), and jafar::rtslam::DataManagerOnePointRansac< RawSpec, SensorSpec, FeatureSpec, RoiSpec, FeatureManagerSpec, DetectorSpec, MatcherSpec >::writeLogHeader().
Generated on Wed Oct 15 2014 00:37:40 for Jafar by doxygen 1.7.6.1 |