How to log information

This section explains how to log information.

Log levels

There are several log levels possible, depending on the kind of message:

  • fatal: designates very severe error events that will presumably lead the application to abort.
  • error: designates error events that might still allow the application to continue running.
  • warning: designates potentially harmful situations.
  • info: designates informational messages that highlight the progress of the application at coarse-grained level.
  • debug: designates fine-grained informational events that are most useful to debug an application.

You should choose the log level according to the information you want to display. For example, if you do not manage to connect to your module, and catch an exception, you should log this as an error. If you are running a face detection module and detect a face, you could log each new face detection as an info, and extra information as debug.

Using qiLog

Aldebaran provides a way to log information: qiLog. This API allows to implement the different log levels described above.

This is documented here.