diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af8b1d9..1cc9ace 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,11 +66,11 @@ repos: - id: remove-tabs exclude_types: [makefile, binary] - repo: https://github.com/danielhoherd/pre-commit-hooks - rev: 07f5a00b0f7d7856d602baf5e530a4d4472d7bf3 + rev: ac0637d7febb88d1b01f876e47bb5224a9a63eae hooks: - id: CVE-2017-18342 - - id: remove-unicode-zero-width-space + - id: remove-en-dashes - id: remove-unicode-non-breaking-spaces - id: remove-unicode-zero-width-non-breaking-spaces - - id: remove-en-dashes + - id: remove-unicode-zero-width-space - id: sort-gitignore diff --git a/plexdl/cli.py b/plexdl/cli.py index 51a8fcb..908bec0 100755 --- a/plexdl/cli.py +++ b/plexdl/cli.py @@ -20,12 +20,13 @@ def get_logger(ctx, param, value): """Get logger and return verbosity value.""" logging.basicConfig(format="%(message)s") log = logging.getLogger("plexdl") - log.setLevel(50 - (value * 10)) # https://docs.python.org/3.7/library/logging.html#logging-levels + if value > 0: + log.setLevel("DEBUG") # https://docs.python.org/3.7/library/logging.html#logging-levels return value @command() -@option("-v", count=True, help="Increase verbosity (max -vvvv)", callback=get_logger) +@option("-v", count=True, help="Be verbose", callback=get_logger) @option("-u", "--username", help="Your Plex username (env PLEXDL_USER)", envvar="PLEXDL_USER") @option("-p", "--password", help="Your Plex password (env PLEXDL_PASS)", envvar="PLEXDL_PASS") @option("-r", "--relay/--no-relay", default=False, help="Output relay servers along with direct servers") diff --git a/plexdl/plexdl.py b/plexdl/plexdl.py index 89f55c5..3c015ed 100644 --- a/plexdl/plexdl.py +++ b/plexdl/plexdl.py @@ -34,7 +34,7 @@ def __init__(self, **kwargs): @staticmethod def print_item_info(self, item, access_token): """Print info about a given media item.""" - log.critical(f"Filesystem locations: {item.locations}") + log.debug(f"Filesystem locations: {item.locations}") if hasattr(item, "iterParts"): locations = [i for i in item.iterParts() if i] for location in locations: