Move log level to settings
All checks were successful
Build Docker image / test (push) Successful in 2m50s
Build Docker image / build (push) Successful in 53s

This commit is contained in:
Roman Krček
2024-10-13 20:24:33 +02:00
parent 940f97a951
commit 47472d59b7
2 changed files with 6 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
import logging
import os
LOG_LEVEL = os.getenv("LOG_LEVEL")
from telegram_downloader_bot.settings import settings
def configure_logger(log_level: str) -> logging.Logger:
@@ -18,4 +17,4 @@ def configure_logger(log_level: str) -> logging.Logger:
return logging.getLogger()
log = configure_logger(LOG_LEVEL)
log = configure_logger(settings.log_level)

View File

@@ -32,6 +32,9 @@ class Settings(BaseSettings):
A list or comma-separated string of IDs that are allowed access
to the bot or application.
log_level : str
The log level used for logging module.
Config:
-------
env_file : str
@@ -45,6 +48,7 @@ class Settings(BaseSettings):
bot_token: str
storage: os.path
allowed_ids: str
log_level: str
class Config:
env_file = ".env"