From: Frank Brehm Date: Mon, 3 Jul 2017 12:43:25 +0000 (+0200) Subject: Defining log level for module ldap3 X-Git-Tag: 0.1.2~172^2~2 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=44df41d9a75a287c45cba2785d9911d0db0ec125;p=pixelpark%2Fadmin-tools.git Defining log level for module ldap3 --- diff --git a/pp_lib/ldap_app.py b/pp_lib/ldap_app.py index 8ceb202..d8964a9 100644 --- a/pp_lib/ldap_app.py +++ b/pp_lib/ldap_app.py @@ -31,6 +31,8 @@ from ldap3 import SUBTREE from ldap3.core.exceptions import LDAPPasswordIsMandatoryError +from ldap3.utils.log import set_library_log_detail_level, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED + # Own modules from .global_version import __version__ as __global_version__ @@ -124,6 +126,17 @@ class PpLdapApplication(PpConfigApplication): cfg_encoding=cfg_encoding, need_config_file=need_config_file, ) + if self.verbose > 3: + set_library_log_detail_level(EXTENDED) + elif self.verbose > 2: + set_library_log_detail_level(NETWORK) + elif self.verbose > 1: + set_library_log_detail_level(PROTOCOL) + elif self.verbose: + set_library_log_detail_level(BASIC) + else: + set_library_log_detail_level(ERROR) + # ------------------------------------------------------------------------- def perform_config(self): """