Replies: 1 comment
-
|
Hi @astrochun , I just started using Rich, and looking for exactly this. Can you share the solution if you were able to figure it out. TIA |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a FastAPI application where I previously configured stdout and file logging using the python
loggingstandard library. Here, I'm using YAML for configuration for both the application anduvicornlog. I'm now working on migrating this to use Rich.I'm able to configure the console logs to use Rich. The YAML config looks something like this:
However, I wonder if there's a way to pass a
RichFormatter withTimedRotatingFileHandleras I do like rich text and would like for mylog.*()to appear as it would be in the log (albeit rich color would not be available but at least emoji will be handled).I know there's a way to specify a
Consolewithfile=open(...), but don't think rotating file is supported withinRich. Thus, I think replacing the formatter used inprecisemay be the best solution. Has anyone done this or know how?Beta Was this translation helpful? Give feedback.
All reactions