Robotics StackExchange | Archived questions

Using RCUTILS logging macros

Hi, What is the proper way of using the logging macros of rcutils ? I am using RCUTILS_LOG_DEBUG("message") for printing debug statements, but the "message" is not getting printed in the console, even though my node running properly.

Thanks for the help.

Asked by Skyking on 2018-04-16 06:48:38 UTC

Comments

Are e.g. INFO messages printed? I guess you have to set the logger level to debug. I'm not sure, but if it is anything like in ROS1, the default is INFO and higher.

Asked by mgruhler on 2018-04-16 07:18:55 UTC

Answers

https://github.com/ros2/ros2/wiki/Logging-and-logger-configuration links to the source code of a logging demo that has different usage examples in C++. The suggestion from @mig to set the logger level to debug is also appropriate (your macro call is using the unnamed logger at the moment). We recommend using named logger objects as in the logging demo, especially for nodes, so that if the node name gets remapped the logger name will get remapped also.

Asked by dhood on 2018-05-02 16:34:29 UTC

Comments