Skip to content

Commit

Permalink
Re #7405 Save log for each job
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Jul 9, 2013
1 parent a69a931 commit fb2f9f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/scripts/reduction_workflow/command_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def OutputPath(path):
ReductionSingleton().set_output_path(path)
ReductionSingleton().reduction_properties["OutputDirectory"] = path

def Reduce1D():
return ReductionSingleton().reduce()
def Reduce1D(log_file=None):
return ReductionSingleton().reduce(log_file=log_file)

def Reduce():
return ReductionSingleton().reduce()
def Reduce(log_file=None):
return ReductionSingleton().reduce(log_file=log_file)

def AppendDataFile(datafile, workspace=None):
"""
Expand Down
8 changes: 6 additions & 2 deletions Code/Mantid/scripts/reduction_workflow/reducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def post_process(self):
"""
pass

def reduce(self):
def reduce(self, log_file=None):
"""
Go through the list of reduction steps
"""
Expand Down Expand Up @@ -206,7 +206,11 @@ def reduce(self):
output_dir = os.path.expanduser('~')

self.log_text += "Reduction completed in %g sec\n" % (time.time()-t_0)
log_path = os.path.join(output_dir,"%s_reduction.log" % self.instrument_name)
if log_file is not None:
base_name = os.path.basename(log_file)
log_path = os.path.join(output_dir, base_name)
else:
log_path = os.path.join(output_dir,"%s_reduction.log" % self.instrument_name)
self.log_text += "Log saved to %s" % log_path

# Write the log to file
Expand Down

0 comments on commit fb2f9f5

Please sign in to comment.