From d3f01176f8067e7b7e5894650f52d87415dbbf88 Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Thu, 29 Aug 2024 16:36:49 -0600 Subject: [PATCH] fix logging override --- confidant/scripts/archive.py | 5 +++-- confidant/scripts/migrate.py | 5 +++-- confidant/scripts/migrate_bool.py | 5 +++-- confidant/scripts/restore.py | 5 +++-- confidant/scripts/utils.py | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/confidant/scripts/archive.py b/confidant/scripts/archive.py index 17d23353..6bc9741c 100644 --- a/confidant/scripts/archive.py +++ b/confidant/scripts/archive.py @@ -11,8 +11,9 @@ logging = importlib.import_module(settings.LOGGING_MODULE) logger = logging.getLogger(__name__) -logger.addHandler(logging.StreamHandler(sys.stdout)) -logger.setLevel(logging.INFO) +if settings.LOGGING_MODULE == 'logging': + logger.addHandler(logging.StreamHandler(sys.stdout)) + logger.setLevel(logging.INFO) class ArchiveCredentials(Command): diff --git a/confidant/scripts/migrate.py b/confidant/scripts/migrate.py index c32142fe..7cc73cf5 100644 --- a/confidant/scripts/migrate.py +++ b/confidant/scripts/migrate.py @@ -14,8 +14,9 @@ logging = importlib.import_module(settings.LOGGING_MODULE) logger = logging.getLogger(__name__) -logger.addHandler(logging.StreamHandler(sys.stdout)) -logger.setLevel(logging.INFO) +if settings.LOGGING_MODULE == 'logging': + logger.addHandler(logging.StreamHandler(sys.stdout)) + logger.setLevel(logging.INFO) def is_old_unicode_set(values): diff --git a/confidant/scripts/migrate_bool.py b/confidant/scripts/migrate_bool.py index f324a3c2..84473a36 100644 --- a/confidant/scripts/migrate_bool.py +++ b/confidant/scripts/migrate_bool.py @@ -16,8 +16,9 @@ logging = importlib.import_module(settings.LOGGING_MODULE) logger = logging.getLogger(__name__) -logger.addHandler(logging.StreamHandler(sys.stdout)) -logger.setLevel(logging.INFO) +if settings.LOGGING_MODULE == 'logging': + logger.addHandler(logging.StreamHandler(sys.stdout)) + logger.setLevel(logging.INFO) class GenericCredential(Model): diff --git a/confidant/scripts/restore.py b/confidant/scripts/restore.py index 3d5bb874..9b0ac90a 100644 --- a/confidant/scripts/restore.py +++ b/confidant/scripts/restore.py @@ -11,8 +11,9 @@ logging = importlib.import_module(settings.LOGGING_MODULE) logger = logging.getLogger(__name__) -logger.addHandler(logging.StreamHandler(sys.stdout)) -logger.setLevel(logging.INFO) +if settings.LOGGING_MODULE == 'logging': + logger.addHandler(logging.StreamHandler(sys.stdout)) + logger.setLevel(logging.INFO) class RestoreCredentials(Command): diff --git a/confidant/scripts/utils.py b/confidant/scripts/utils.py index cde7ecd4..94b52548 100644 --- a/confidant/scripts/utils.py +++ b/confidant/scripts/utils.py @@ -12,8 +12,9 @@ logging = importlib.import_module(settings.LOGGING_MODULE) logger = logging.getLogger(__name__) -logger.addHandler(logging.StreamHandler(sys.stdout)) -logger.setLevel(logging.INFO) +if settings.LOGGING_MODULE == 'logging': + logger.addHandler(logging.StreamHandler(sys.stdout)) + logger.setLevel(logging.INFO) class ManageGrants(Command):