Set logging location in config

This commit is contained in:
Jeremy "EndenDragon" Zhang 2017-09-06 21:00:09 -07:00 committed by GitHub
parent 600627d2e2
commit 71b29cd75d

View File

@ -9,6 +9,7 @@ import sys
import logging import logging
import json import json
logging.basicConfig(filename='titanbot.log',level=logging.INFO,format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') logging.basicConfig(filename='titanbot.log',level=logging.INFO,format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
handler = logging.FileHandler(config.get("logging-location", "titanbot.log"))
logging.getLogger('TitanBot') logging.getLogger('TitanBot')
logging.getLogger('sqlalchemy') logging.getLogger('sqlalchemy')
@ -265,4 +266,4 @@ class Titan(discord.Client):
for msg in self.messages: for msg in self.messages:
if msg.id == msg_id: if msg.id == msg_id:
return True return True
return False return False