|
60 | 60 | resolve_overrides, |
61 | 61 | resolve_tool_uri, |
62 | 62 | ) |
63 | | -from .loghandler import _logger, defaultStreamHandler |
| 63 | +from .loghandler import _logger, configure_logging, defaultStreamHandler |
64 | 64 | from .mpi import MpiConfig |
65 | 65 | from .mutation import MutationManager |
66 | 66 | from .pack import pack |
@@ -624,31 +624,6 @@ def supported_cwl_versions(enable_dev: bool) -> List[str]: |
624 | 624 | return versions |
625 | 625 |
|
626 | 626 |
|
627 | | -def configure_logging( |
628 | | - args: argparse.Namespace, |
629 | | - stderr_handler: logging.Handler, |
630 | | - runtimeContext: RuntimeContext, |
631 | | -) -> None: |
632 | | - rdflib_logger = logging.getLogger("rdflib.term") |
633 | | - rdflib_logger.addHandler(stderr_handler) |
634 | | - rdflib_logger.setLevel(logging.ERROR) |
635 | | - if args.quiet: |
636 | | - # Silence STDERR, not an eventual provenance log file |
637 | | - stderr_handler.setLevel(logging.WARN) |
638 | | - if runtimeContext.debug: |
639 | | - # Increase to debug for both stderr and provenance log file |
640 | | - _logger.setLevel(logging.DEBUG) |
641 | | - stderr_handler.setLevel(logging.DEBUG) |
642 | | - rdflib_logger.setLevel(logging.DEBUG) |
643 | | - fmtclass = coloredlogs.ColoredFormatter if args.enable_color else logging.Formatter |
644 | | - formatter = fmtclass("%(levelname)s %(message)s") |
645 | | - if args.timestamps: |
646 | | - formatter = fmtclass( |
647 | | - "[%(asctime)s] %(levelname)s %(message)s", "%Y-%m-%d %H:%M:%S" |
648 | | - ) |
649 | | - stderr_handler.setFormatter(formatter) |
650 | | - |
651 | | - |
652 | 627 | def setup_schema( |
653 | 628 | args: argparse.Namespace, custom_schema_callback: Optional[Callable[[], None]] |
654 | 629 | ) -> None: |
@@ -724,6 +699,8 @@ def setup_loadingContext( |
724 | 699 | ) -> LoadingContext: |
725 | 700 | if loadingContext is None: |
726 | 701 | loadingContext = LoadingContext(vars(args)) |
| 702 | + loadingContext.singularity = runtimeContext.singularity |
| 703 | + loadingContext.podman = runtimeContext.podman |
727 | 704 | else: |
728 | 705 | loadingContext = loadingContext.copy() |
729 | 706 | loadingContext.loader = default_loader( |
@@ -966,7 +943,13 @@ def main( |
966 | 943 | if not hasattr(args, key): |
967 | 944 | setattr(args, key, val) |
968 | 945 |
|
969 | | - configure_logging(args, stderr_handler, runtimeContext) |
| 946 | + configure_logging( |
| 947 | + stderr_handler, |
| 948 | + args.quiet, |
| 949 | + runtimeContext.debug, |
| 950 | + args.enable_color, |
| 951 | + args.timestamps, |
| 952 | + ) |
970 | 953 |
|
971 | 954 | if args.version: |
972 | 955 | print(versionfunc()) |
|
0 commit comments