diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-12-19 19:57:43 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-12-19 19:57:43 +0100 |
commit | 914d11c84198295a9f09756fe436f3114d4b0075 (patch) | |
tree | b4f0aca94c60b20b9ccbeb34368400a86db909a0 | |
parent | 37c6868a92b0d1252a8a7a60c16620a4d252d7b5 (diff) | |
download | fietsboek-914d11c84198295a9f09756fe436f3114d4b0075.tar.gz fietsboek-914d11c84198295a9f09756fe436f3114d4b0075.tar.bz2 fietsboek-914d11c84198295a9f09756fe436f3114d4b0075.zip |
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.
-rw-r--r-- | fietsboek/updater/cli.py | 5 |
1 files changed, 5 insertions, 0 deletions
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() |