Merge pull request #8 from Etzelia/patch-6

Updated log to use an absolute path.
doc_update
Joey Hines 2018-09-12 12:36:23 -05:00 committed by GitHub
commit 6b8e3aeb0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -154,8 +154,8 @@ def setup_logging(config):
bot_info_logger = logging.getLogger('geoffrey.bot')
bot_info_logger.setLevel(logging.INFO)
handler = handlers.TimedRotatingFileHandler(filename='Geoffrey.log', when='D',
interval=config.rotation_duration, backupCount=config.count,
handler = handlers.TimedRotatingFileHandler(filename="{}/Geoffrey.log".format(path.dirname(path.abspath(__file__))),
when='D', interval=config.rotation_duration, backupCount=config.count,
encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))