mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
logging: port to standard Python logging
Use the standard `logging` module to configure logging instead of the in-house `ipapython.log_manager` module and remove `ipapython.log_manager`. Disable the logging-not-lazy and logging-format-interpolation pylint checks. Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
464516489f
commit
f62a0fdb90
@@ -22,6 +22,7 @@
|
||||
Handles common operations like option parsing and logging
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
import traceback
|
||||
@@ -230,8 +231,12 @@ class AdminTool(object):
|
||||
Logging to file is only set up after option validation and prompting;
|
||||
before that, all output will go to the console only.
|
||||
"""
|
||||
if 'console' in ipa_log_manager.log_mgr.handlers:
|
||||
ipa_log_manager.log_mgr.remove_handler('console')
|
||||
root_logger = ipa_log_manager.root_logger
|
||||
for handler in root_logger.handlers:
|
||||
if (isinstance(handler, logging.StreamHandler) and
|
||||
handler.stream is sys.stderr): # pylint: disable=no-member
|
||||
root_logger.removeHandler(handler)
|
||||
break
|
||||
|
||||
self._setup_logging(log_file_mode=log_file_mode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user