Skip to content

validate_bids: add -l|--log-level control and do log some information #1116

@yarikoptic

Description

@yarikoptic

Inspired by

ATM there seems to be no control over how "verbose" tool should be:

❯ validate_bids --help
usage: validate_bids [-h] [-ec ERROR_LIMIT] [-ef ERRORS_BY_FILE] [-f {text,json,json_pp}] [-o OUTPUT_FILE] [-p] [-s [SUFFIXES ...]] [-v] [-w] [-x [EXCLUDE_DIRS ...]] data_path

Validate a BIDS-formatted HED dataset.

positional arguments:
  data_path             Full path of dataset root directory.

options:
  -h, --help            show this help message and exit
  -ec ERROR_LIMIT, --error_count ERROR_LIMIT
                        Limit the number of errors of each code type to report for text output.
  -ef ERRORS_BY_FILE, --errors_by_file ERRORS_BY_FILE
                        Apply error limit by file rather than overall for text output.
  -f {text,json,json_pp}, --format {text,json,json_pp}
                        Output format: 'text' (default) or 'json' ('json_pp' for pretty-printed json)
  -o OUTPUT_FILE, --output_file OUTPUT_FILE
                        Full path of output of validator -- otherwise output written to standard error.
  -p, --print_output    If present, output the results to standard out in addition to any saving of the files.
  -s [SUFFIXES ...], --suffixes [SUFFIXES ...]
                        Optional list of suffixes (no under_bar) of tsv files to validate. If -s with no values, will use all possible suffixes as with single argument '*'.
  -v, --verbose         If present, output informative messages as computation progresses.
  -w, --check_for_warnings
                        If present, check for warnings as well as errors.
  -x [EXCLUDE_DIRS ...], --exclude-dirs [EXCLUDE_DIRS ...]
                        Directories name to exclude in search for files to validate.

I would expect to have smth like (copying from dandi --help)

  -l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
                                  Log level (case insensitive).  May be
                                  specified as an integer.  [default: INFO]

and with -l DEBUG showing progress on what client considers to validate etc, so if crashes -- we know what it was doing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions