Skip to content

Commit 3f2e923

Browse files
endothermicdevcdecker
authored andcommitted
reckless: fix verbose option
The switch to logging enabled verbose output regardless of the option flag. Here the functionality is restored. Changelog-Fixed: reckless verbosity properly applied.
1 parent 9751502 commit 3f2e923

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/reckless

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def _install_plugin(src: InstInfo) -> bool:
338338
# clone git repository to /tmp/reckless-...
339339
if ('http' in src.repo[:4]) or ('github.com' in src.repo):
340340
# Ugly, but interactively handling stderr gets hairy.
341-
if IS_VERBOSE:
341+
if logging.root.level < logging.WARNING:
342342
git = Popen(['git', 'clone', src.repo, str(clone_path)],
343343
stdout=PIPE)
344344
else:
@@ -660,7 +660,9 @@ if __name__ == '__main__':
660660
type=str,
661661
default=None)
662662
parser.add_argument('-r', '--regtest', action='store_true')
663-
parser.add_argument('-v', '--verbose', action='store_true')
663+
# parser.add_argument('-v', '--verbose', action='store_true')
664+
parser.add_argument('-v', '--verbose', action="store_const",
665+
dest="loglevel", const=logging.DEBUG, default=logging.WARNING)
664666
cmd1 = parser.add_subparsers(dest='cmd1', help='command',
665667
required=True)
666668

@@ -724,7 +726,7 @@ if __name__ == '__main__':
724726
RECKLESS_CONFIG = load_config(reckless_dir=RECKLESS_DIR,
725727
network=NETWORK)
726728
RECKLESS_SOURCES = loadSources()
727-
IS_VERBOSE = bool(args.verbose)
729+
logging.root.setLevel(args.loglevel)
728730

729731
if 'targets' in args:
730732
# FIXME: Catch missing argument

0 commit comments

Comments
 (0)