]> Frank Brehm's Git Trees - pixelpark/ldap-migration.git/commitdiff
Fixing logging
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 7 Dec 2020 17:22:04 +0000 (18:22 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 7 Dec 2020 17:22:04 +0000 (18:22 +0100)
lib/ldap_migration/__init__.py

index 5a03095a2f6d957aa02196949a0cf7b814422f9a..6507871a736728ed8b2b2234374d5c9f564d10a2 100644 (file)
@@ -45,7 +45,7 @@ from .config import LDAPMigrationConfiguration
 from .idict import CaseInsensitiveDict
 from .istringset import CaseInsensitiveStringSet
 
-__version__ = '0.8.7'
+__version__ = '0.8.8'
 
 LOG = logging.getLogger(__name__)
 CFG_BASENAME = 'ldap-migration.ini'
@@ -368,7 +368,9 @@ class LDAPMigrationApplication(BaseApplication):
         """
 
         log_level = logging.INFO
-        if self.quiet:
+        if self.verbose:
+            log_level = logging.DEBUG
+        elif self.quiet:
             log_level = logging.WARNING
 
         root_logger = logging.getLogger()
@@ -378,7 +380,10 @@ class LDAPMigrationApplication(BaseApplication):
 
         # create log handler for console output
         lh_console = logging.StreamHandler(sys.stderr)
-        lh_console.setLevel(log_level)
+        if self.quiet:
+            lh_console.setLevel(logging.WARNING)
+        else:
+            lh_console.setLevel(logging.INFO)
         lh_console.setFormatter(formatter)
 
         root_logger.addHandler(lh_console)
@@ -390,6 +395,7 @@ class LDAPMigrationApplication(BaseApplication):
             else:
                 paramiko_logger.setLevel(logging.INFO)
 
+        # create log handler for file output
         lf_formatter = self._get_logfile_formatter()
         lh_file = logging.FileHandler(
                 str(self.general_logfile), mode='a', encoding='utf-8', delay=True)