"""Shared utility helpers."""

import logging
import sys

LOG_FORMAT = "%(asctime)s [%(levelname)s] %(name)s: %(message)s"


def setup_logging(verbose: bool = False) -> logging.Logger:
    """Configure and return the package-level logger."""
    level = logging.DEBUG if verbose else logging.WARNING
    logging.basicConfig(format=LOG_FORMAT, level=level, stream=sys.stderr)
    return logging.getLogger("dataset_inspector")
