From 44df41d9a75a287c45cba2785d9911d0db0ec125 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 3 Jul 2017 14:43:25 +0200 Subject: [PATCH] Defining log level for module ldap3 --- pp_lib/ldap_app.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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): """ -- 2.39.5