Skip to content

Commit

Permalink
fix: reduce logging by keeping option for more verbose (#323)
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm authored Nov 13, 2024
1 parent 5a44236 commit 8b437ad
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docling/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ def convert(
output: Annotated[
Path, typer.Option(..., help="Output directory where results are saved.")
] = 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[
Optional[bool],
typer.Option(
Expand All @@ -195,7 +204,12 @@ def convert(
),
] = 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:
from_formats = [e for e in InputFormat]
Expand Down

0 comments on commit 8b437ad

Please sign in to comment.