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:
1 parent
7aa78ee060
commit
5f5eb2fe13
1 file changed
+2
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user