How to configure ROS_INFO to print a human readable time? [closed]
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!
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.Thanks! I would have done that later, but I just wanted to quickly test it.
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.
That only allows to a limited amount of modifications. I am more interested in Configuration.
Yes, I thought so. I just thought it might help if you knew about that, but apparently you already do. :)
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!
Duplicate: https://answers.ros.org/question/1748...