21 #define BOOST_TEST_MODULE debug - logger 23 #if BOOST_VERSION >= 105900 24 #include <boost/test/tools/output_test_stream.hpp> 26 #include <boost/test/output_test_stream.hpp> 28 #include <boost/test/unit_test.hpp> 30 using boost::test_tools::output_test_stream;
80 <<
"This is a message of level MSG_TYPE_DEBUG\n";
83 <<
"This is a message of level MSG_TYPE_INFO\n";
86 <<
"This is a message of level MSG_TYPE_WARNING\n";
89 <<
"This is a message of level MSG_TYPE_ERROR\n";
92 <<
"This is a message of level MSG_TYPE_DEBUG_STREAM\n";
95 <<
"This is a message of level MSG_TYPE_INFO_STREAM\n";
98 <<
"This is a message of level MSG_TYPE_WARNING_STREAM\n";
101 <<
"This is a message of level MSG_TYPE_ERROR_STREAM\n";
107 std::vector<double> vq;
113 <<
"Value to display: " <<
toString(vq) <<
'\n';
116 <<
"Value to display: " <<
toString(vq, 3, 10) <<
'\n';
118 Eigen::Matrix<double, 3, 3> an_eig_m;
121 <<
"Value to display: " <<
toString(an_eig_m) <<
'\n';
132 of.open(
"/tmp/dg-LOGS.txt", std::ofstream::out | std::ofstream::app);
147 for (
unsigned int i = 0; i < 10000; i++) {
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
#define dgADD_OSTREAM_TO_RTLOG(ostr)
bool setTimeSample(double t)
Set the time sample.
BOOST_AUTO_TEST_CASE(debug_logger)
static const std::string CLASS_NAME
virtual const std::string & getClassName() const
double getTimeSample()
Get the time sample.
bool setTimeSample(double t)
void setVerbosity(LoggerVerbosity lv)
bool setStreamPrintPeriod(double s)
std::string toString(const T &v, const int precision=3, const int width=-1)
CustomEntity(const std::string &n)
double getStreamPrintPeriod()
Get the period of the stream period.
Entity(const std::string &name)
LoggerVerbosity getVerbosity()
Entity * newEntity(const std::string &classname, const std::string &objname) const
Instantiate (and allocate) an entity.
static FactoryStorage * getInstance()
Get pointer to unique object of the class.
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity")
bool setStreamPrintPeriod(double t)
Set the period of the stream period.
static RealTimeLogger & instance()