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

Why does rosconsole log look different than rosout.log

asked 2020-09-30 01:56:57 -0600

borgcons gravatar image

updated 2020-09-30 01:58:25 -0600

When I have the following environment variable:

ROSCONSOLE_FORMAT=[${severity}] [${time}] [${node}]: ${message}

This is the output to the terminal:

[ INFO] [1601445805.714924273] [/gnss_receiver]: node started

But in the .ros/log/latest/rosout.log it looks like this:

1601445805.714961571 INFO [.../gnss_receiver_node.cpp:105(main) [topics: /rosout] node started

Is there a way to format rosout.log?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-02 05:21:46 -0600

Weasfas gravatar image

Hi @borgcons,

ROSCONSOLE_FORMAT allows you to specify how you would like the rosconsole output to show up in the terminal. Since it is a environment variable it will only affects the current shell you are using, although you can add it to the .bashrc.

On the other hand, the format with which the log is generated is harcoded in the rosout node, that subscribes to /rosout, logs the messages to file, and re-broadcasts the messages to /rosout_agg. Hence, if you want to change the output log, either you change that node (that is not recommended), accepts that format how it is or implement a new node (bare copy of the rosout node) that does the same thing but changing the format with the one you want.

Hope that helps you.


edit flag offensive delete link more



Worth putting a stress: Since ROSCONSOLE_FORMATis an environment variable, it can be defined in a launch file (I just added an example of defining without a config file)

130s gravatar image 130s  ( 2020-10-02 05:52:15 -0600 )edit

Question Tools



Asked: 2020-09-30 01:56:57 -0600

Seen: 511 times

Last updated: Oct 02 '20