fix: reduce logging by keeping option for more verbose (#323)
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
5a44236ac2
commit
8b437adcde
@ -185,6 +185,15 @@ def convert(
|
|||||||
output: Annotated[
|
output: Annotated[
|
||||||
Path, typer.Option(..., help="Output directory where results are saved.")
|
Path, typer.Option(..., help="Output directory where results are saved.")
|
||||||
] = Path("."),
|
] = Path("."),
|
||||||
|
verbose: Annotated[
|
||||||
|
int,
|
||||||
|
typer.Option(
|
||||||
|
"--verbose",
|
||||||
|
"-v",
|
||||||
|
count=True,
|
||||||
|
help="Set the verbosity level. -v for info logging, -vv for debug logging.",
|
||||||
|
),
|
||||||
|
] = 0,
|
||||||
version: Annotated[
|
version: Annotated[
|
||||||
Optional[bool],
|
Optional[bool],
|
||||||
typer.Option(
|
typer.Option(
|
||||||
@ -195,7 +204,12 @@ def convert(
|
|||||||
),
|
),
|
||||||
] = None,
|
] = None,
|
||||||
):
|
):
|
||||||
logging.basicConfig(level=logging.INFO)
|
if verbose == 0:
|
||||||
|
logging.basicConfig(level=logging.WARNING)
|
||||||
|
elif verbose == 1:
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
elif verbose == 2:
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
if from_formats is None:
|
if from_formats is None:
|
||||||
from_formats = [e for e in InputFormat]
|
from_formats = [e for e in InputFormat]
|
||||||
|
Loading…
Reference in New Issue
Block a user