summaryrefslogtreecommitdiffstats
path: root/ipapython/ipa_log_manager.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-06-08 09:36:38 -0400
committerRob Crittenden <rcritten@redhat.com>2012-06-17 21:47:06 -0400
commit3e0116491f701222bd3941d0ad58feb7fe670ac4 (patch)
tree4cc283e562e1213d8c0b7319601124d06aa8454b /ipapython/ipa_log_manager.py
parente94733f04d35a1cab167f2bc4280b22d414f0470 (diff)
downloadfreeipa-3e0116491f701222bd3941d0ad58feb7fe670ac4.tar.gz
freeipa-3e0116491f701222bd3941d0ad58feb7fe670ac4.tar.xz
freeipa-3e0116491f701222bd3941d0ad58feb7fe670ac4.zip
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
Diffstat (limited to 'ipapython/ipa_log_manager.py')
-rw-r--r--ipapython/ipa_log_manager.py5
1 files changed, 3 insertions, 2 deletions
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)