Logging added #34

Merged
Miroslavsckaya merged 3 commits from feature_logging into master 2022-07-10 12:07:27 +00:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit 01ab35210f - Show all commits

6
bot.py
View file

@ -13,7 +13,11 @@ db_path = os.getenv('DATABASE_PATH', './bot.db')
log_level = os.getenv('LOG_LEVEL', 'INFO')
print('Starting the bot with logging level', log_level.upper())
logging.basicConfig(level=log_level.upper(), format='%(asctime)s: <%(name)s> [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
logging.basicConfig(
level=log_level.upper(),
format='%(asctime)s: <%(name)s> [%(levelname)s] %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
)
db = Database(db_path, logging.getLogger('Database'))
bot = CommandProcessor(token, db, logging.getLogger('CommandProcessor'))

View file

@ -1,6 +1,6 @@
import logging
from dotenv import load_dotenv
import os
from dotenv import load_dotenv
from rss import RssReader
from update_manager import UpdateManager
@ -14,7 +14,11 @@ db_path = os.getenv('DATABASE_PATH', './bot.db')
log_level = os.getenv('LOG_LEVEL', 'INFO')
print('Starting the updater with logging level', log_level.upper())
logging.basicConfig(level=log_level.upper(), format='%(asctime)s: <%(name)s> [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
logging.basicConfig(
level=log_level.upper(),
format='%(asctime)s: <%(name)s> [%(levelname)s] %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
db = Database(db_path, logging.getLogger('Database'))
notifier = Notifier(token, logging.getLogger('Notifier'))