From 39c95681f3bbe87832890798ff5565ec6513f108 Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sat, 22 Dec 2018 00:31:59 +0100 Subject: [PATCH] reduce default verbosity --- README.md | 3 ++- src/pycalver/__main__.py | 2 +- src/pycalver/vcs.py | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6e59cba..1ea823f 100644 --- a/README.md +++ b/README.md @@ -527,7 +527,7 @@ different commits. This is mitigates a rare corner case where ```shell -$ pycalver show +$ pycalver show --verbose INFO - fetching tags from remote (to turn off use: -n / --no-fetch) Current Version: v201812.0005-beta PEP440 Version : 201812.5b0 @@ -547,6 +547,7 @@ To increment and publish a new version, you can use the 5. *Tag* the new commit. 6. *Push* the new commit and tag. + ``` $ pycalver bump --dry --- setup.cfg diff --git a/src/pycalver/__main__.py b/src/pycalver/__main__.py index 9bbe6d5..cd504e5 100644 --- a/src/pycalver/__main__.py +++ b/src/pycalver/__main__.py @@ -47,7 +47,7 @@ def _init_logging(verbose: int = 0) -> None: log_level = logging.DEBUG elif verbose == 1: log_format = "%(levelname)-7s - %(message)s" - log_level = logging.DEBUG + log_level = logging.INFO else: log_format = "%(levelname)-7s - %(message)s" log_level = logging.INFO diff --git a/src/pycalver/vcs.py b/src/pycalver/vcs.py index b796650..19cfbe9 100644 --- a/src/pycalver/vcs.py +++ b/src/pycalver/vcs.py @@ -62,9 +62,10 @@ class VCS: def __call__(self, cmd_name: str, env=None, **kwargs: str) -> str: """Invoke subcommand and return output.""" - cmd_str = self.subcommands[cmd_name] - cmd_parts = cmd_str.format(**kwargs).split() - output_data = sp.check_output(cmd_parts, env=env, stderr=sp.STDOUT) + cmd_tmpl = self.subcommands[cmd_name] + cmd_str = cmd_tmpl.format(**kwargs) + log.debug(cmd_str) + output_data = sp.check_output(cmd_str.split(), env=env, stderr=sp.STDOUT) # TODO (mb 2018-11-15): Detect encoding of output? _encoding = "utf-8"