audiogen gains --log-level

This commit is contained in:
boyska 2021-03-27 12:29:20 +01:00
parent b8c7bd424e
commit e8f061ec63

View file

@ -3,7 +3,7 @@ import sys
import argparse
from .entrypoints_utils import get_one_entrypoint
import json
from logging import getLogger
from logging import getLogger, basicConfig
log = getLogger("audiogen")
@ -15,6 +15,7 @@ def get_audiogenerator(kind):
def get_parser():
parser = argparse.ArgumentParser(description="Generate audio and output paths")
parser.add_argument("--log-level", choices=['DEBUG', 'INFO', 'WARNING', 'DEBUG'], default='WARNING')
parser.add_argument(
"audiospec",
metavar="AUDIOSPEC",
@ -49,6 +50,7 @@ def audiogenerate(spec):
def main():
"""Main function for the "larigira-audiogen" executable"""
args = get_parser().parse_args()
basicConfig(level=args.log_level)
spec = read_spec(args.audiospec[0])
errors = tuple(check_spec(spec))
if errors: