Parse sub-second digits in ROSCONSOLE_FORMAT
In ROS noetic, one can change the way dates and times are represented by doing export ROSCONSOLE_FORMAT='${time:format string}'
.
I am using the following: export ROSCONSOLE_FORMAT='[${severity}] [${time:%Y-%m-%d %H:%M:%S.%f}]: ${message}'
because displaying only the seconds is not enough for my application.
However, it seems that there are 2 types of logs (maybe roscpp vs rospy?):
Type 1
[ INFO] [1636988628.662548891]: msg
This gets parsed ok, i.e. I get the first 6 decimal points (not 9 though which is weird)
For example, I see [ INFO] [2021-11-14 14:35:45.662548]: msg
Type 2
[INFO] [1636988672.555812]: msg
This does not get parsed ok, i.e. I get the string %f
instead of the actual decimal points.
For example, I see [ INFO] [2021-11-14 14:35:45.%f]: msg
That's surprising given that this has 6 decimal points which is what I'm getting in Type 1
. Any idea how to parse this correctly?
Can you paste the output you are getting? What do you mean by "parsed OK"?
Updated question with more concrete examples.