Commit 7f18f5e4 authored by Vitezslav Humpa's avatar Vitezslav Humpa
Browse files

logger: handle situation of config changing during execution

parent dd95fb3f
Pipeline #2288123 failed with stages
......@@ -98,10 +98,11 @@ class Logger(object):
"""
self.logName = logName
self.stdOut = stdOut
self.fileName = None
self.filee = file # Handle to the logfile
if self.filee == '' or self.filee == str(''):
self.filee = False
if isinstance(self.filee, bool):
if not self.filee:
return
scriptName = config.scriptName
......@@ -134,6 +135,8 @@ class Logger(object):
def createFile(self):
# Try to create the file and write the header info
if self.fileName is None and os.path.isdir(config.logDir):
self.findUniqueName()
print("Creating logfile at %s ..." % self.fileName)
self.filee = open(self.fileName, mode='w')
self.filee.write("##### " + os.path.basename(self.fileName) + '\n')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment