Skip to content

Commit e4b5d92

Browse files
committed
--no-warnings for even quieter output (errors only)
1 parent 0005383 commit e4b5d92

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

cwltool/argparser.py

+1
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def arg_parser() -> argparse.ArgumentParser:
378378

379379
volumegroup = parser.add_mutually_exclusive_group()
380380
volumegroup.add_argument("--verbose", action="store_true", help="Default logging")
381+
volumegroup.add_argument("--no-warnings", action="store_true", help="Only print errors.")
381382
volumegroup.add_argument("--quiet", action="store_true", help="Only print warnings and errors.")
382383
volumegroup.add_argument("--debug", action="store_true", help="Print even more logging")
383384

cwltool/loghandler.py

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
def configure_logging(
1313
stderr_handler: logging.Handler,
14+
no_warnings: bool,
1415
quiet: bool,
1516
debug: bool,
1617
enable_color: bool,
@@ -25,6 +26,8 @@ def configure_logging(
2526
deps_logger.addHandler(stderr_handler)
2627
ss_logger = logging.getLogger("salad")
2728
ss_logger.addHandler(stderr_handler)
29+
if no_warnings:
30+
stderr_handler.setLevel(logging.ERROR)
2831
if quiet:
2932
# Silence STDERR, not an eventual provenance log file
3033
stderr_handler.setLevel(logging.WARN)

cwltool/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ def main(
10131013

10141014
configure_logging(
10151015
stderr_handler,
1016+
args.no_warnings,
10161017
args.quiet,
10171018
runtimeContext.debug,
10181019
args.enable_color,

tests/test_js_sandbox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
("v7.7.3\n", True),
2323
]
2424

25-
configure_logging(_logger.handlers[-1], False, True, True, True)
25+
configure_logging(_logger.handlers[-1], False, False, True, True, True)
2626
_logger.setLevel(logging.DEBUG)
2727

2828

tests/test_load_tool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from .util import get_data
1818

19-
configure_logging(_logger.handlers[-1], False, True, True, True)
19+
configure_logging(_logger.handlers[-1], False, False, True, True, True)
2020
_logger.setLevel(logging.DEBUG)
2121

2222

0 commit comments

Comments
 (0)