Open mloughran opened 3 weeks ago
Dunno, are free to make an issue/thread suggesting it and see what others think.
@mloughran @Blacksmoke16 I have the same code and bug in mosquito -- I'm sure I copied this stanza from Granite to Mosquito, or the reverse depending on the day.
@robacarp ha, well that does support my case. There's some similar code in Clear (and I'm sure all sorts of other places), but thankfully this wasn't a copy-paste 😄
Given that the common use case seems to be logging, maybe there is an argument for handling Time::Span
in log metadata. This however then raises the question of how the JSON logger should serialise spans (see https://github.com/crystal-lang/crystal/issues/11942). In any case this is all rather off-topic for this PR! I will consider some more and may open a crystal issue.
Has been broken since it was originally implemented in 3d73a5de.
Noticed while implementing a similar method in our own code. @Blacksmoke16 is something of this ilk (more readable short span printing) a candidate for stdlib do you think?