Milliseconds in RichHandler timestamps #984
Unanswered
finnhughes
asked this question in
Q&A
Replies: 1 comment 11 replies
-
Rich uses |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm new to this fantastic looking library, thanks.
I want to use RichHandler for logging and like milliseconds in my timestamps. For now I've specified
datefmt='%H:%M:%S.%f'
but I'd prefer not to have microseconds. In the python formatter if you don't specify datefmt you get milliseconds by default but that's not possible with RichHandler. With the python formatter you can embed the timestamp in the message but then RichHandler doesn't recognise it as a timestamp anymore.I had a quick look to see if there was something I could easily override but my best guess was overriding the LogRender call dunder function and that didn't feel very tidy.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions