11/* *
22\page subp_logger Loggers
33
4- \section sec_logger Initialization of the logger
4+ \section sec_init_rt_logger Initialization of the logger
55
6- \subsection subsec_logger_hcpp Header and preprocessor variable
6+ \subsection subsec_init_rt_logger_hcpp Header and preprocessor variable
77
88In order to activate the logger you need to add the following lines:
99\code
@@ -22,57 +22,20 @@ It is possible to set the output stream of the messages inside a file:
2222
2323 dynamicgraph::RealTimeLogger::destroy();
2424\endcode
25- Here the file is "/tmp/dg-LOGS.txt".
2625
27- \subsection subsec_logger_init Initialization of the logger
26+ \section sec_use_rt_logger Using the rt_logger
2827
29- Inside the constructor of the entity:
30- \code
31- logger_.setTimeSample(0.001);
32- logger_.setStreamPrintPeriod(0.005);
33- logger_.setVerbosity(VERBOSITY_ALL);
34- LoggerVerbosity alv = logger_.getVerbosity();
35- \endcode
36-
37- The first line sets the frequency at which the logger will be updated.<br>
38- The second line specifies at which frequency the STREAM messages should be
39- printed.<br>
40- The third line specifies the level of message to accept.<br>
41- The fourth line returns the level of verbosity.
42- In this case, all messages are accepted and the STREAM message are displayed on
43- the output streams once on five. <br>
44-
45- The full list of options are:
46- <ul>
47- <li>VERBOSITY_ALL: Accept all messages</li>
48- <li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO,
49- WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum
50- level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum
51- level : ERROR</li>
52- </ul>
5328
29+ \newcode
30+ // Somewhere in your library
31+ dgRTLOG() << "your message. Prefer to use \n than std::endl."
32+ \endcode
5433
55- \section sec_logger_tests Displaying messages
5634
57- Here is some example on how to display or record some information.
58- \code
59- sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG,
60- __FILE__,__LINE__); sendMsg("This is a message of level
61- MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); sendMsg("This is a message of
62- level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); sendMsg("This is a
63- message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
64- sendMsg("This is a message of level
65- MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); sendMsg("This
66- is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM,
67- __FILE__,__LINE__); sendMsg("This is a message of level
68- MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
69- sendMsg("This is a message of level
70- MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
35+ Here the output file is "/tmp/dg-LOGS.txt".
7136
72- logger_.countdown();
73- \endcode
7437
7538Specifying the file with __FILE__ and the line inside the file by __LINE__ are
7639necessary for the STREAM messages. Indeed they are indexed using the two values.
77- As the default value are "" and 0 the counting will be confused .
40+ The default values "" and 0 for the counting are not well understood .
7841*/
0 commit comments