From 914d11c84198295a9f09756fe436f3114d4b0075 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 19 Dec 2022 19:57:43 +0100 Subject: properly initialize logging in fietsupdate This step would otherwise be done by alembic, which means that we'd lose the first log messages before calling into alembic. --- fietsboek/updater/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fietsboek/updater/cli.py b/fietsboek/updater/cli.py index 5c97687..d19e444 100644 --- a/fietsboek/updater/cli.py +++ b/fietsboek/updater/cli.py @@ -6,6 +6,7 @@ managing migrations between Fietsboek versions. In particular, the updater takes care of running the database migrations, migrating the data directory and migrating the configuration. """ +import logging.config import click from . import Updater @@ -70,6 +71,7 @@ def update(ctx, config, version, force): VERSION specifies the version you want to update to. Leave empty to choose the latest version. """ + logging.config.fileConfig(config) updater = Updater(config) updater.load() if version and not updater.exists(version): @@ -114,6 +116,7 @@ def downgrade(ctx, config, version, force): VERSION specifies the version you want to downgrade to. """ + logging.config.fileConfig(config) updater = Updater(config) updater.load() if version and not updater.exists(version): @@ -143,6 +146,7 @@ def revision(config, revision_id): This command is useful for developers who work on Fietsboek. """ + logging.config.fileConfig(config) updater = Updater(config) updater.load() current = updater.current_versions() @@ -163,6 +167,7 @@ def revision(config, revision_id): @config_option def status(config): """Display information about the current version and available updates.""" + logging.config.fileConfig(config) updater = Updater(config) updater.load() current = updater.current_versions() -- cgit v1.2.3