Robotics StackExchange | Archived questions

stop ros2 logging stdout but to a .log file

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...

Asked by fury.nerd on 2023-02-17 00:05:53 UTC

Comments

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)

Asked by fury.nerd on 2023-02-17 00:27:55 UTC

Answers

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

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

is what i need

Asked by fury.nerd on 2023-02-20 03:21:06 UTC

Comments