Skip to content

Commit 3223902

Browse files
committed
Fix bugs and print -> _logger.info
- Made JavaScript logging work in workflows - Made decoded data be inputted into re.findall - print -> _logger.info, so that js output isn't outputted into stdout and the tests can pick out the information
1 parent 5b6d500 commit 3223902

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cwltool/sandboxjs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ def stdfmt(data): # type: (Text) -> Text
197197

198198
if js_console:
199199
if len(stderrdata) > 0:
200-
print("Javascript console output:")
201-
print("----------------------------------------")
202-
print('\n'.join(re.findall(r'^[[](?:log|err)[]].*$', stderrdata, flags=re.MULTILINE)))
203-
print("----------------------------------------")
200+
_logger.info("Javascript console output:")
201+
_logger.info("----------------------------------------")
202+
_logger.info('\n'.join(re.findall(r'^[[](?:log|err)[]].*$', stderrdata.decode('utf-8'), flags=re.MULTILINE)))
203+
_logger.info("----------------------------------------")
204204

205205
if debug:
206206
info = u"returncode was: %s\nscript was:\n%s\nstdout was: %s\nstderr was: %s\n" %\

cwltool/workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,12 @@ def receive_output(self, step, outputparms, final_output_callback, jobout, proce
332332
if completed == len(self.steps):
333333
self.do_output_callback(final_output_callback)
334334

335-
def try_make_job(self, step, final_output_callback, debug=False, js_console=False, **kwargs):
335+
def try_make_job(self, step, final_output_callback, **kwargs):
336336
# type: (WorkflowJobStep, Callable[[Any, Any], Any], bool, bool, **Any) -> Generator
337+
338+
js_console = kwargs["js_console"] or False
339+
debug = kwargs["debug"] or False
340+
337341
inputparms = step.tool["inputs"]
338342
outputparms = step.tool["outputs"]
339343

0 commit comments

Comments
 (0)