Use a named logger

This commit is contained in:
Valentin Niess
2023-11-10 10:18:12 +01:00
parent e596fec38b
commit e249fdebdb
4 changed files with 29 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
import argparse
from importlib import import_module
import logging
import os
import sys
@@ -24,9 +23,9 @@ def main():
dest='command')
parser.add_argument('-q', '--quiet', help='disable logging',
dest='verbosity', action='store_const', const=logging.ERROR)
dest='verbosity', action='store_const', const='ERROR')
parser.add_argument('-v', '--verbose', help='print extra information',
dest='verbosity', action='store_const', const=logging.DEBUG)
dest='verbosity', action='store_const', const='DEBUG')
install_parser = subparsers.add_parser('install',
description='Install binary dependencies')
@@ -89,7 +88,8 @@ def main():
# Configure the verbosity
if args.verbosity:
logging.getLogger().setLevel(args.verbosity)
from .utils import log
log.set_level(args.verbosity)
# check if no arguments are passed
if args.command is None: