Allow a custom file mode when setting up debugging

This will be handy in the future if we will want to install or uninstall
only single IPA components and want to append to the installation logs.
This will be used by the upcoming ipa-dns-install script.
This commit is contained in:
Martin Nagy 2009-11-23 09:18:25 +01:00 committed by Rob Crittenden
parent 7aa78ee060
commit 5f5eb2fe13

View File

@ -145,14 +145,14 @@ def port_available(port):
return rv
def standard_logging_setup(log_filename, debug=False):
def standard_logging_setup(log_filename, debug=False, filemode='w'):
old_umask = os.umask(077)
# Always log everything (i.e., DEBUG) to the log
# file.
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s',
filename=log_filename,
filemode='w')
filemode=filemode)
os.umask(old_umask)
console = logging.StreamHandler()