Closed sinanerdinc closed 4 months ago
This is really a much better option, in fact, after you made the changes in rich, I realized that we were actually printing the time and level twice, do you think such a solution would make more sense?
let's remove it from the log template and activate it from rich.
log_format = "%(message)s"
logging.basicConfig(
level="INFO", format=log_format, datefmt="[%X]", handlers=[RichHandler(show_time=True, show_level=True)]
)
`
The only issue with using RichHandler is that if two logs arrive simultaneously, only one date will be written. You can check the output in the terminal by running logger.py
If we disable RichHandler and use it via the template, it would work like this.
Hmm, I see. Make sense then, thank you Sinan, it's perfect!
I made an addition so that log management can be handled from a single place instead of configuring it separately in each file.