rclim95 / PlayingWHAT

A Python app that allows you to connect your Spotify account and show what you're playing on the Inky wHAT screen
MIT License
1 stars 0 forks source link

Allow reading log configuration from a configuration file #4

Closed rclim95 closed 4 years ago

rclim95 commented 4 years ago

Right now, logging is currently being hard-coded to the following, where we're using logging.basicConfig to setup logging:

logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO,
                    format="[%(levelname)s] %(asctime)s - %(name)s: %(message)s",
                    stream=sys.stdout)

We should change this so that logging configuration is read from a logging configuration file, so that it isn't tied to the code. For example: https://docs.python.org/3/library/logging.config.html#configuration-file-format

rclim95 commented 4 years ago

This has now been accomplished in commit c096ca559c70fa0542ecb6500d0e25219b23e15b. More specifically, we're using the more-modern dictConfig(). 😄