Branch addition #1

Merged
c0de merged 11 commits from zed/BaseballBot:Toof into main 2024-04-23 22:19:23 +00:00
Showing only changes of commit 17774ae0e2 - Show all commits

View File

@ -4,6 +4,8 @@
# pylint: disable=missing-module-docstring
import logging
from database.models import database, GameModel as Game
@ -24,6 +26,18 @@ class BaseGameManager:
# Discord client instance
self.discord = None
logger = logging.getLogger()
console = logging.StreamHandler()
format_str = '%(asctime)s\t%(levelname)s -- %(processName)s %(filename)s:%(lineno)s -- %(message)s'
console.setFormatter(logging.Formatter(format_str))
logger.addHandler(console)
logger.setLevel(logging.DEBUG)
self.logger = logger
def __enter__(self):
"""
Allows use of `with Game() as game` for try/except statements