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

Logging of ROS_ERROR_STREAM messages?

asked 2016-05-13 11:59:48 -0600

215 gravatar image

updated 2016-05-13 18:02:56 -0600

Mani gravatar image

How do I log ROS_ERROR_STREAM messages into a log file??

Normally i would just do a >> log.txt but, i only want to store the ROS_ERROR_STREAM, and nothing else..

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-05-13 15:08:48 -0600

ahendrix gravatar image

The ros logging macros (rosconsole) use log4cxx and are compatible with log4j configuration files.

It's probably possible to write a configuration file that does what you want, but the documentation is pretty thin:

edit flag offensive delete link more

answered 2016-05-13 14:33:27 -0600

Mani gravatar image

This might not be the best way to do this, but this is what comes to my mind:

$ rosrun sample_pkg sample_node 2>&1 | grep -e "\[ERROR\]" -e "\[FATAL\"] > /path/to/file

Alternatively, you can pipe all messages written to stderr to a file. This includes all ROS WARN, ERROR and FATAL messages: (ref)

$ rosrun sample_pkg sample_node 2>/path/to/file
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-05-13 11:59:48 -0600

Seen: 1,253 times

Last updated: May 13 '16