Branch addition #1
14
game/base.py
14
game/base.py
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
# pylint: disable=missing-module-docstring
|
# pylint: disable=missing-module-docstring
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from database.models import database, GameModel as Game
|
from database.models import database, GameModel as Game
|
||||||
|
|
||||||
|
|
||||||
@ -24,6 +26,18 @@ class BaseGameManager:
|
|||||||
# Discord client instance
|
# Discord client instance
|
||||||
self.discord = None
|
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):
|
def __enter__(self):
|
||||||
"""
|
"""
|
||||||
Allows use of `with Game() as game` for try/except statements
|
Allows use of `with Game() as game` for try/except statements
|
||||||
|
Loading…
Reference in New Issue
Block a user