Files
Telegram-Downloader-Bot/telegram_downloader_bot/logger.py
Roman Krček 47472d59b7
All checks were successful
Build Docker image / test (push) Successful in 2m50s
Build Docker image / build (push) Successful in 53s
Move log level to settings
2024-10-13 20:24:33 +02:00

21 lines
410 B
Python

import logging
from telegram_downloader_bot.settings import settings
def configure_logger(log_level: str) -> logging.Logger:
log_format = (
"%(asctime)s | %(levelname)7s | %(module)10s "
"| %(funcName)20s | %(message)s"
)
logging.basicConfig(
level=log_level,
format=log_format,
)
return logging.getLogger()
log = configure_logger(settings.log_level)