How to configure ROS_INFO to print a human readable time? [closed]

asked 2016-04-22 03:13:51 -0600

Orchaldir gravatar image

updated 2016-04-22 05:42:14 -0600

Hello,

I want to change how the ros logger works from this:

[ INFO] [1461311729.886215631]: ProblemPublisher(): source="Navigation"

to this:

[ INFO] [2016-04-22 07:55:29,508]: ProblemPublisher(): source="Navigation"

It should be possible to do this in $ROS_ROOT/config/rosconsole.config by adding something like this:

log4j.appender.ConsoleAppender.layout.ConversionPattern=[%-5p] %d %c - %m%n

But nothing changes. is it the wrong file or the wrong appender?

Thanks for the help!

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by tfoote
close date 2017-11-30 13:18:58.494974

Comments

1

Good question! I don't have an answer, only a small comment: you shouldn't modify files in $ROS_ROOT. Instead, you can point the environment variable ROSCONSOLE_CONFIG_FILE to a .rosconsole-config file in your home directory.

Martin Günther gravatar imageMartin Günther ( 2016-04-22 03:42:28 -0600 )edit
1

Thanks! I would have done that later, but I just wanted to quickly test it.

Orchaldir gravatar imageOrchaldir ( 2016-04-22 03:57:17 -0600 )edit
1

No problem! Another partially related comment: You can change the output format using the ROSCONSOLE_FORMAT environment variable. That doesn't do what you want; I still thought I'd mention it.

Martin Günther gravatar imageMartin Günther ( 2016-04-22 06:15:20 -0600 )edit

That only allows to a limited amount of modifications. I am more interested in Configuration.

Orchaldir gravatar imageOrchaldir ( 2016-04-22 06:25:28 -0600 )edit

Yes, I thought so. I just thought it might help if you knew about that, but apparently you already do. :)

Martin Günther gravatar imageMartin Günther ( 2016-04-22 06:57:09 -0600 )edit

Nice question! I do need the real date and time too for debugging. But I still don't know how can I do it correctly and I wonder why the rospy logs do contain the date but those of cpp nodes don't. It would be very kind to answer your question and share the config file you've come up with. Thanks!

Jasmin gravatar imageJasmin ( 2017-10-13 03:29:43 -0600 )edit
tfoote gravatar imagetfoote ( 2017-11-30 13:18:41 -0600 )edit