Skip to content

Commit

Permalink
flush logfile before a subprocess is started
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Nov 28, 2018
1 parent d1f9a3b commit 5e676f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def log_section(name):
name = '%s %d' % (name, counter)
_logfile_sections.add(name)
_logfile.write('\n[%s]\n' % name)

def log_flush():
_logfile.flush()

def log_value(key, value):
Expand Down
1 change: 1 addition & 0 deletions workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ def run_job(self, job, show_progress, new_line=True):
utils.log_value('input', job.std_input)
utils.log_value('prog', job.args[0])
utils.log_value('args', ' '.join(pipes.quote(a) for a in job.args[1:]))
utils.log_flush()
# job.args[0] = 'true' # for debugging
try:
process = Popen(job.args, stdin=PIPE, stdout=PIPE, stderr=PIPE,
Expand Down

0 comments on commit 5e676f5

Please sign in to comment.