cobanov / tasnif

A Python toolkit for image clustering using deep learning, PCA, and K-means, with support for GPU and CPU processing. Simplify your image analysis projects with advanced embeddings, dimensionality reduction, and automated visual categorization.
MIT License
31 stars 3 forks source link

A logger file has been added for log management. #3

Closed sinanerdinc closed 4 months ago

sinanerdinc commented 4 months ago

I made an addition so that log management can be handled from a single place instead of configuring it separately in each file.

cobanov commented 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)]
)
`
sinanerdinc commented 4 months ago

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

image

If we disable RichHandler and use it via the template, it would work like this.

image
cobanov commented 4 months ago

Hmm, I see. Make sense then, thank you Sinan, it's perfect!

cobanov commented 4 months ago

https://github.com/cobanov/tasnif/releases/tag/0.1.10