This is an archive of the discontinued LLVM Phabricator instance.

Support formatv of TimePoint with strftime-style formats.
ClosedPublic

Authored by sammccall on Oct 17 2017, 1:37 AM.

Details

Summary

Support formatv of TimePoint with strftime-style formats.

Extensions for millis/micros/nanos are added.
Inital use case is HH:MM:SS.MMM timestamps in clangd logs.

Event Timeline

sammccall created this revision.Oct 17 2017, 1:37 AM

I wanted to add something like this myself, but never got around to doing that. Thanks.

lib/Support/Chrono.cpp
65

This won't correctly handle the case when the % is already escaped (e.g. %%foobar).

sammccall updated this revision to Diff 119308.Oct 17 2017, 6:23 AM

Respect %% escape when preprocessing format strings.

sammccall marked an inline comment as done.Oct 17 2017, 6:24 AM

Oops, nice catch! Added a test.

bkramer accepted this revision.Oct 23 2017, 7:11 PM

I think this can go in now.

This revision is now accepted and ready to land.Oct 23 2017, 7:11 PM
This revision was automatically updated to reflect the committed changes.