Quick introduction
Each entity has a protected logger_ object. The simplest way to have information while running your graph is to initialize it in the constructor, and then display information in the methods.
You can then change the level of information you want to display using either the entity method setLoggerVerbosityLevel() or the corresponding python bindings.
Putting information in your
entity.
It is possible to define the periodicity of the logger:
logger_.setTimeSample(0.001);
To define the periodicity at which one wants to print information:
logger_.setStreamPrintPeriod(0.005);
Several level of verbosity are possible:
The full list of options are:
-
VERBOSITY_ALL: Accept all messages
-
VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO, WARNING, ERROR
-
VERBOSITY_WARNING_ERROR: Accept messages at minimum level : WARNING, ERROR
-
VERBOSITY_ERROR: Accept messages at minimum level : ERROR
It is specified by the enum LoggerVerbosity
It is possible to display information according to various level of debug:
or
(*this) << "This is a message of level MSG_TYPE_DEBUG_STREAM\n";
(*this) << "This is a message of level MSG_TYPE_ERROR_STREAM\n";
- Note
- Thread safety. This class expects to have:
- only one reader: the one who take the log entries and write them somewhere.
- one writer at a time. Writing to the logs is never a blocking operation. If the resource is busy, the log entry is discarded.