Ask Your Question
0

Logging of ROS_ERROR_STREAM messages?

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

215 gravatar image

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

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
0

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

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: http://logging.apache.org/log4cxx/usa...

edit flag offensive delete link more
1

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 639 times

Last updated: May 13 '16