ticket 2022 - modify codebase to utilize IPALogManager, obsoletes logging

change default_logger_level to debug in configure_standard_logging

add new ipa_log_manager module, move log_mgr there, also export
root_logger from log_mgr.

change all log_manager imports to ipa_log_manager and change
log_manager.root_logger to root_logger.

add missing import for parse_log_level()
This commit is contained in:
John Dennis
2011-11-15 14:39:31 -05:00
committed by Martin Kosek
parent 730f1228a9
commit 56401c1abe
44 changed files with 697 additions and 807 deletions

View File

@@ -33,6 +33,7 @@ from ipalib import api, errors, util
from ipapython.config import IPAOptionParser
import krbV
import ldap
from ipapython.ipa_log_manager import *
def parse_options():
parser = IPAOptionParser(version=version.VERSION)
@@ -82,11 +83,11 @@ def main():
if os.getegid() != 0:
sys.exit("Must be root to setup AD trusts on server")
standard_logging_setup("/var/log/ipaserver-install.log", options.debug, filemode='a')
standard_logging_setup("/var/log/ipaserver-install.log", debug=options.debug, filemode='a')
print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log"
logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
logging.debug("missing options might be asked for interactively later\n")
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug("missing options might be asked for interactively later\n")
installutils.check_server_configuration()
@@ -149,7 +150,7 @@ def main():
sys.exit("Aborting installation.")
ip_address = str(ip)
logging.debug("will use ip_address: %s\n", ip_address)
root_logger.debug("will use ip_address: %s\n", ip_address)
if not options.unattended:
print ""
@@ -245,5 +246,5 @@ except Exception, e:
message = str(e)
for str in traceback.format_tb(sys.exc_info()[2]):
message = message + "\n" + str
logging.debug(message)
root_logger.debug(message)
sys.exit(1)