dynamic-graph  4.1.0-8-gdab7-dirty
Dynamic graph library
Loggers

Initialization of the logger

Header and preprocessor variable

In order to activate the logger you need to add the following lines:

#define ENABLE_RT_LOG
#include <dynamic-graph/logger.h>
#include <dynamic-graph/real-time-logger.h>

Initialize the output stream

It is possible to set the output stream of the messages inside a file:

dynamicgraph::RealTimeLogger::instance();
of.open("/tmp/dg-LOGS.txt",std::ofstream::out|std::ofstream::app);
dgADD_OSTREAM_TO_RTLOG (of);
dynamicgraph::RealTimeLogger::destroy();

Using the rt_logger

// Somewhere in your library
dgRTLOG() << "your message. Prefer to use \n than std::endl."

Here the output file is "/tmp/dg-LOGS.txt".

Specifying the file with FILE and the line inside the file by LINE are necessary for the STREAM messages. Indeed they are indexed using the two values. The default values "" and 0 for the counting are not well understood.