From 3e0116491f701222bd3941d0ad58feb7fe670ac4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 8 Jun 2012 09:36:38 -0400 Subject: Improve ipa-client-install debug output The client does a fair bit of work when trying to validate the hostnames, do discovery and verify that the server it gets back is an IPA server. The debug logging around this was horrid with very little state information, duplicate log messages or just nothing at all. In many cases errors were printed only to stderr/stdout. This patch makes the logging and output go through the IPA log manager. It sets up logging so that INFO, WARNING, and ERROR messages show up on the console. If -d is given, DEBUG messages are also printed. All messages also go to the log file. The only exception is user input: prompts are only printed to the console, but if the user provides any information it is echoed in a DEBUG-level message. https://fedorahosted.org/freeipa/ticket/2553 --- ipapython/ipa_log_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ipapython/ipa_log_manager.py') diff --git a/ipapython/ipa_log_manager.py b/ipapython/ipa_log_manager.py index 7841eabfb..8af0f79a7 100644 --- a/ipapython/ipa_log_manager.py +++ b/ipapython/ipa_log_manager.py @@ -171,7 +171,8 @@ class IPALogManager(LogManager): #------------------------------------------------------------------------------- -def standard_logging_setup(filename=None, verbose=False, debug=False, filemode='w'): +def standard_logging_setup(filename=None, verbose=False, debug=False, + filemode='w', console_format=LOGGING_FORMAT_STANDARD_CONSOLE): handlers = [] # File output is always logged at debug level @@ -195,7 +196,7 @@ def standard_logging_setup(filename=None, verbose=False, debug=False, filemode=' console_handler = dict(name='console', stream=sys.stderr, level=level, - format=LOGGING_FORMAT_STANDARD_CONSOLE) + format=console_format) handlers.append(console_handler) -- cgit