Skip to content

Commit

Permalink
FIX: Use consistent logger, set sensible default level, enable -q
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 9, 2024
1 parent 25897f3 commit 3ab24bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tools/schemacode/bidsschematools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

@click.group()
@click.option("-v", "--verbose", count=True)
def cli(verbose):
@click.option("-q", "--quiet", count=True)
def cli(verbose, quiet):
"""BIDS Schema Tools"""
logging.getLogger("bidsschematools").setLevel(logging.INFO - verbose * 10)
verbose = verbose - quiet
logging.getLogger("bidsschematools").setLevel(logging.WARNING - verbose * 10)


@cli.command()
Expand Down
2 changes: 1 addition & 1 deletion tools/schemacode/bidsschematools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_logger(name=None):
logging.Logger
logger object.
"""
return logging.getLogger("bids-schema" + (".%s" % name if name else ""))
return logging.getLogger("bidsschematools" + (".%s" % name if name else ""))


def set_logger_level(lgr, level):
Expand Down

0 comments on commit 3ab24bf

Please sign in to comment.