88from .helpers .files import FileHelper
99from .helpers .vcs import VcsHelper
1010from .helpers .venvs import VenvHelper
11- from .utils import chdir
11+ from .utils import chdir , configure_logging
1212
1313LOG = logging .getLogger (__name__ )
1414
@@ -348,11 +348,14 @@ def find_packages(cls, where: Path, *, prefer: str) -> list[Path]:
348348
349349 return packages_found
350350
351- def __init__ (self , project_path : Path = None ):
351+ def __init__ (self , project_path : Path = None , * , log_level : int = None ):
352352 """
353353 :param project_path: Application root (containing pyproject.toml) path.
354+ :param log_level: Logging level
354355
355356 """
357+ self .configure_logging (log_level )
358+
356359 project_path = project_path or os .getcwd ()
357360 self .project_path = Path (project_path )
358361 self .package : PackageData | None = None
@@ -363,6 +366,15 @@ def __init__(self, project_path: Path = None):
363366 with chdir (self .project_path ):
364367 self ._gather_data ()
365368
369+ def configure_logging (self , verbosity_lvl : int = None , format : str = '%(message)s' ):
370+ """Switches on logging at a given level.
371+
372+ :param verbosity_lvl:
373+ :param format:
374+
375+ """
376+ configure_logging (verbosity_lvl , logger = LOG , format = format )
377+
366378 def _gather_data (self ):
367379 """Gathers data relevant for project related functions."""
368380 project_path = self .project_path
0 commit comments