ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

rclpy: Change the output format of the default logger (RcutilsLogger)

asked 2020-11-13 05:13:26 -0600

CraigH92 gravatar image

My log messages look like:

[INFO] [1605205588.116214862] [path_to_node.subsystem_name.node_name]: Here is a log message

The bit before the actual message takes up too much horizontal space, making it hard to read in my console (I'm using terminator, and have other consoles within it). I have already tried reducing the font size, but it still rarely fits on one line.

Could I change it so it is more like:

[INFO] [node_name]: Here is a log message

Or even:

[INFO]: Here is a log message

As often I do not care where the log message has come from.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-13 06:42:15 -0600

CraigH92 gravatar image

Figured it out.

I just need to set an eninonment variable, i.e type:

export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity}]: {message}"

Into the console, I am running the node from.

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



Asked: 2020-11-13 05:13:26 -0600

Seen: 347 times

Last updated: Nov 13 '20