mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
7aa78ee060
commit
5f5eb2fe13
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user