-
In the span I'll like to add a field to show some elapsed time, for example:
However it'll print a float like Right now I can do
To limit the no. of decimal places, as well as a suffix |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not the best thing ever, but you can create a struct Then you should be able to You could also do the same thing with |
Beta Was this translation helpful? Give feedback.
It's not the best thing ever, but you can create a struct
PrettyFloat(f64)
and implementstd::fmt::Debug
on it so that it uses exactly the format you want.Then you should be able to
info!(x = debug(PrettyFloat(y)));
and it'll use yourDebug
implementation.You could also do the same thing with
Display
if you'd prefer.