Skip to content
Snippets Groups Projects
Commit 1c9d731a authored by David Verelst's avatar David Verelst
Browse files

launch.py: don't keep creating a new log file in crontab mode

parent 420c27b2
No related branches found
No related tags found
No related merge requests found
...@@ -931,8 +931,12 @@ if __name__ == '__main__': ...@@ -931,8 +931,12 @@ if __name__ == '__main__':
path_log = os.path.join(os.getcwd(), 'launch_scheduler_log.txt') path_log = os.path.join(os.getcwd(), 'launch_scheduler_log.txt')
elif not os.path.isabs(options.logfile): elif not os.path.isabs(options.logfile):
path_log = os.path.join(os.getcwd(), options.logfile) path_log = os.path.join(os.getcwd(), options.logfile)
# log to file and do not print messages # log to file and do not print messages, but in crontab mode, append!
output = Logger(open(path_log, 'w'), True) if os.path.exists(path_log) and options.crontab:
mode = 'a'
else:
mode = 'w'
output = Logger(open(path_log, mode), True)
sys.stdout = output sys.stdout = output
else: else:
path_log = None path_log = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment