Ask Your Question
1

Why does rosconsole log look different than rosout.log

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

borgcons gravatar image

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

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
1

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

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.

Regards.

edit flag offensive delete link more

Comments

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) http://wiki.ros.org/rosconsole#Config...

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

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

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

Seen: 185 times

Last updated: Oct 02 '20