diff --git a/src/logwatcher/cli.py b/src/logwatcher/cli.py index e2305e0..ae25c02 100644 --- a/src/logwatcher/cli.py +++ b/src/logwatcher/cli.py @@ -43,6 +43,7 @@ def _is_log_file(path: Path) -> bool: def _get_files_from_dir(input_dir: Path) -> list[Path]: if not input_dir.exists(): + logger.error(f"Unrecognized input directory '{input_dir}'.") raise FileNotFoundError(f"No such directory at '{input_dir}'") return [file for file in input_dir.iterdir() if _is_log_file(file)] @@ -51,6 +52,7 @@ def _files_to_log_entries(input_files: list[Path]) -> list[LogEntry]: log_entries = [] for file in input_files: if not file.is_file(): + logger.error(f"Unrecognized input file '{file}'.") raise ValueError(f"'{file}' is not a file") log_entries.extend(parse_log_file(file)) return log_entries @@ -110,6 +112,7 @@ def cli( logger.info(f"input_dir option selected with value {input_dir}") log_files = _get_files_from_dir(input_dir) else: + logger.error("Neither input-files nor input-dir were provided.") raise typer.BadParameter("Either input_files or input_dir must be provided") logger.info(f"reports will be located at '{output_dir.cwd()}'")