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

Comments

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