Geoffrey-Django/Geoffrey.py

38 lines
942 B
Python
Raw Normal View History

2018-08-11 21:07:33 +00:00
""""
Geoffrey Minecraft Info Database
2018-07-21 18:28:31 +00:00
2018-08-11 21:07:33 +00:00
Created by: Joey Hines (ZeroHD)
2018-05-22 02:41:15 +00:00
2018-08-11 21:07:33 +00:00
"""
import logging
import logging.handlers as handlers
from bot import start_bot
from BotConfig import bot_config
2018-08-11 21:07:33 +00:00
def setup_logging():
2018-05-25 16:32:29 +00:00
2018-08-11 21:07:33 +00:00
discord_logger = logging.getLogger('discord')
discord_logger.setLevel(logging.DEBUG)
sql_logger = logging.getLogger('sqlalchemy.engine')
sql_logger.setLevel(logging.INFO)
2018-05-25 22:00:43 +00:00
2018-08-11 21:07:33 +00:00
handler = handlers.TimedRotatingFileHandler(filename='Geoffrey.log', when='D',
interval=bot_config.rotation_duration, backupCount=bot_config.count,
encoding='utf-8')
2018-05-25 16:32:29 +00:00
2018-08-11 21:07:33 +00:00
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
2018-08-11 21:07:33 +00:00
discord_logger.addHandler(handler)
sql_logger.addHandler(handler)
2018-06-03 02:42:31 +00:00
2018-05-21 16:57:20 +00:00
if __name__ == '__main__':
2018-08-11 21:07:33 +00:00
setup_logging()
start_bot()