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

stop ros2 logging stdout but to a .log file

asked 2023-02-16 23:05:53 -0600

fury.nerd gravatar image

updated 2023-02-16 23:12:41 -0600

I need to write a test shell script, is there a enviroment variable config (or something like ros2 run pkg node --param) that could stop ros2 logging stdout (stop brush screen) but still can log to a file?

i tried export ROS_LOG_DIR=~/my_logs as in this doc, .log file is ok for me, but there is still screen brushing...

edit retag flag offensive close merge delete


actually the logging info is come from ros2 bag play ... in the test shell script, i just found ros2 run logging_demo logging_demo_main | grep hihi & by grep could stop screen-brushing, but no effort for ros2 bag play ...|grep hihi (with grep there still screen-brushing)

fury.nerd gravatar image fury.nerd  ( 2023-02-16 23:27:55 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-02-20 02:21:06 -0600

fury.nerd gravatar image

updated 2023-02-20 02:22:31 -0600

found out looks like ros2 logging use stderr as output, so

ros2 bag play ${bag_path} > p.log  2>&1

is what i need

edit flag offensive delete link more

Question Tools



Asked: 2023-02-16 23:05:53 -0600

Seen: 88 times

Last updated: Feb 20