|
| 1 | +/** |
| 2 | +\page subp_debug_rt_logger Real-time Logger |
| 3 | +
|
| 4 | + \section real_time_logger_quick_intro Quick introduction |
| 5 | + Each entity has a protected logger_ object. |
| 6 | + The simplest way to have information while running your graph is to initialize |
| 7 | + it in the constructor, and then display information in the methods. |
| 8 | +
|
| 9 | + You can then change the level of information you want to display using |
| 10 | + either the entity method setLoggerVerbosityLevel() |
| 11 | + or the corresponding python bindings. |
| 12 | +
|
| 13 | + \section real_time_logger_modifying_entities Putting information in your entity. |
| 14 | +
|
| 15 | + It is possible to define the periodicity of the logger: |
| 16 | + \code |
| 17 | + logger_.setTimeSample(0.001); |
| 18 | + \endcode |
| 19 | +
|
| 20 | + To define the periodicity at which one wants to print information: |
| 21 | + \code |
| 22 | + logger_.setStreamPrintPeriod(0.005); |
| 23 | + \endcode |
| 24 | +
|
| 25 | + Several level of verbosity are possible: |
| 26 | + \code |
| 27 | + logger_.setVerbosity(VERBOSITY_ALL); |
| 28 | + \endcode |
| 29 | + The full list of options are: |
| 30 | +<ul> |
| 31 | +<li>VERBOSITY_ALL: Accept all messages</li> |
| 32 | +<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO, |
| 33 | +WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum |
| 34 | +level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum |
| 35 | +level : ERROR</li> |
| 36 | +</ul> |
| 37 | +
|
| 38 | +It is specified by the enum LoggerVerbosity |
| 39 | + |
| 40 | + It is possible to display information according to various level of debug: |
| 41 | + \code |
| 42 | + sendMsg("This is a message of level MSG_TYPE_DEBUG", MSG_TYPE_DEBUG); |
| 43 | + \endcode |
| 44 | + or |
| 45 | + \code |
| 46 | + DYNAMIC_GRAPH_ENTITY_DEBUG (*this) << "This is a message of level MSG_TYPE_DEBUG\n"; |
| 47 | + DYNAMIC_GRAPH_ENTITY_INFO (*this) << "This is a message of level MSG_TYPE_INFO\n"; |
| 48 | + DYNAMIC_GRAPH_ENTITY_WARNING (*this) << "This is a message of level MSG_TYPE_WARNING\n"; |
| 49 | + DYNAMIC_GRAPH_ENTITY_ERROR (*this) << "This is a message of level MSG_TYPE_ERROR\n"; |
| 50 | + DYNAMIC_GRAPH_ENTITY_DEBUG_STREAM (*this) << "This is a message of level MSG_TYPE_DEBUG_STREAM\n"; |
| 51 | + DYNAMIC_GRAPH_ENTITY_INFO_STREAM (*this) << "This is a message of level MSG_TYPE_INFO_STREAM\n"; |
| 52 | + DYNAMIC_GRAPH_ENTITY_WARNING_STREAM (*this) << "This is a message of level MSG_TYPE_WARNING_STREAM\n"; |
| 53 | + DYNAMIC_GRAPH_ENTITY_ERROR_STREAM (*this) << "This is a message of level MSG_TYPE_ERROR_STREAM\n"; |
| 54 | + \endcode |
| 55 | + |
| 56 | +
|
| 57 | + \note Thread safety. This class expects to have: |
| 58 | + - only one reader: the one who take the log entries and write them somewhere. |
| 59 | + - one writer at a time. Writing to the logs is **never** a blocking |
| 60 | + operation. If the resource is busy, the log entry is discarded. |
| 61 | +*/ |
0 commit comments