ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Filtering out ROS2 rclcpp and rcl debug logs

asked 2021-10-29 08:00:10 -0500

apoorvcn47 gravatar image

Hi I am using ROS2 Foxy. My node has several types logging statements (info, debug, error). When I set the logging level to info, i see my error and info statements, which is expected. when i set the logging level to debug, i see all my logging statements but i also see bunch of logging statements from RCL and RCLCPP which I don't want to see. Is there a way I an filter out these system logs and only see my custom logging statements?

Thank you

edit retag flag offensive close merge delete


I have the exact same need already for a long time, and haven't really found any proper solution. The trick I'm using now is for example ros2 run package node --ros-args --log-level DEBUG | grep -v '[rcl]' which removes the rcl stuff from the terminal output, but it will still write all the stuff in the log file. I would like to have a solution, where even into the file is not written the rcl stuff, because my log files become very heavy to handle, and could be reduced by 80% of it size just by removing all the rcl stuff.

ahopsu gravatar image ahopsu  ( 2022-02-10 05:24:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-11-23 05:11:53 -0500

tommy_erko gravatar image

You can set log level specifically for the underlying components of your node (rcl, rclcpp, dds).

ros2 run package node --ros-args --log-level DEBUG --log-level rcl:=INFO

This way your node will output on DEBUG level, but rcl will be muted.

edit flag offensive delete link more

Question Tools



Asked: 2021-10-29 08:00:10 -0500

Seen: 804 times

Last updated: Oct 29 '21