From 7fa01b4b102c2aef1c5e7bed46a20aa9357e1697 Mon Sep 17 00:00:00 2001 From: Thomas Erlang Date: Wed, 9 Mar 2022 17:51:49 +0100 Subject: [PATCH] Fixed logging for upgrade command --- tbot/runner.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tbot/runner.py b/tbot/runner.py index 5f9afcf..c043f11 100644 --- a/tbot/runner.py +++ b/tbot/runner.py @@ -39,7 +39,7 @@ def discord(): @cli.command() def upgrade(): - logger.set_logger('', fmt='%(message)s', sentry_dsn=config['sentry_dsn']) + logger.set_logger('migration.log', sentry_dsn=config['sentry_dsn']) from yoyo import read_migrations from yoyo import get_backend @@ -49,11 +49,14 @@ def upgrade(): config['mysql']['host'], config['mysql']['port'], config['mysql']['database'], - )) + )) + log = logging.getLogger('main') + log.setLevel('INFO') + log.info('Upgrade started') migrations = read_migrations(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'migrations')) with backend.lock(): backend.apply_migrations(backend.to_apply(migrations)) - logging.info('Upgrade done') + log.info('Upgrade done') @cli.command() def twitch_eventsub_check():