Added LOG_LEVEL env var, to make it configurable through .env

This commit is contained in:
Kamil
2024-11-24 21:14:47 +00:00
parent 961e175a7d
commit e5416ed800
2 changed files with 4 additions and 1 deletions

View File

@@ -103,7 +103,8 @@ app = Flask(__name__, template_folder="../templates", static_folder='../static')
# app.logger.addHandler(stream_handler)
app.config.from_object(Config)
app.logger.setLevel(logging.DEBUG)
log_level = getattr(logging, app.config['LOG_LEVEL'], logging.INFO) # Default to DEBUG if invalid
app.logger.setLevel(log_level)
Config.validate_env_vars()
cache = Cache(app)