0
$\begingroup$

Rosanswers logo

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


Originally posted by apoorvcn47 on ROS Answers with karma: 43 on 2021-10-29

Post score: 1


Original comments

Comment by ahopsu on 2022-02-10:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by tommy_erko with karma: 26 on 2022-11-23

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.