common-workflow-language / common-workflow-language/cwltool
Output log formats for CommandLineTool and Workflow are (slightly) not consistent
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
Here is an output of `CommandLineTool` (I confirmed it using the conformance test 1).
```
...
[2019-04-15 15:50:52] [job bwa-mem-tool.cwl] initializing from file:///Users/tom-tan/repos/cwl-metrics/cwl-log-generator/test/conformance-1/cwl/bwa-mem-tool.cwl
...
```
The most of the lines consist of:
- date (`2019-04-15 15:50:52`)
- kind of CWL document (`job` or `workflow`) and the file name to be processed (`job bwa-mem-tool.cwl`)
- The format becomes slightly different when the job or workflow is in the workflow step but it is not the matter of this issue. This issue is about the case when it is used in the root level.
- the log message (`initializing from...`)
Therefore, we expect that we can see the same format in the case of `Workflow`.
## Expected Behavior
It contains the file name of the given workflow.
```
...
[2019-04-15 15:50:37] [workflow revsort.cwl] initialized from file:///Users/tom-tan/repos/cwl-metrics/cwl-log-generator/test/conformance-53/cwl/revsort.cwl
...
```
## Actual Behavior
It does not contain the file name of the given workflow.
```
...
[2019-04-15 15:50:37] [workflow ] initialized from file:///Users/tom-tan/repos/cwl-metrics/cwl-log-generator/test/conformance-53/cwl/revsort.cwl
...
```
It would be nice if it contains the file name even in the case of workflows.
The file name can be set in [`workflow.py`#230](https://github.com/common-workflow-language/cwltool/blob/875b928ce50a3202f5954843b79ea86683c160fa/cwltool/workflow.py#L230) but currently the empty string is set there because the [`getdefault`](https://github.com/common-workflow-language/cwltool/blob/875b928ce50a3202f5954843b79ea86683c160fa/cwltool/context.py#L143) function with `val == ''` returns `''` rather than `default`. I am not sure it is intended or not.
## Workflow Code
I confirmed it happens with the conformance test 53 ([revsort.cwl](https://github.com/common-workflow-language/common-workflow-language/blob/master/v1.0/v1.0/revsort.cwl) and [revsort-job.json](https://github.com/common-workflow-language/common-workflow-language/blob/master/v1.0/v1.0/revsort-job.json)).
## Your Environment
* cwltool version:
```
$ cwltool --version
/Users/tom-tan/.pyenv/versions/3.6.5/bin/cwltool 1.0.20190228155703
```
Contributor guide
Assessment
This issue has not been assessed yet.