Skip to content

Commit

Permalink
feat: ✨ allow adjustment of verbosity in data-prep cli
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunes5thmoon committed Oct 3, 2024
1 parent 868e06d commit 2c3872d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/cellmap_utils_kit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
for each command, e.g. `data-prep copy-crops --help`
"""

import logging
from typing import Sequence

import click
Expand All @@ -37,9 +38,21 @@


@click.group()
def cli() -> None:
@click.option(
"-v",
"--verbose",
count=True,
help="Increase verbosity level (-v for INFO, -vv for DEBUG).",
)
def cli(verbose: int) -> None:
"""Data preparation CLI."""
pass
# Set the logging level based on the verbosity
if verbose == 1:
logging.basicConfig(level=logging.INFO)
elif verbose > 1:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.WARNING)


@click.command(name="copy-crops")
Expand Down

0 comments on commit 2c3872d

Please sign in to comment.