diff --git a/Makefile b/Makefile index 79701d78..affecc71 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -UTIL_VERSION := 0.5.13 +UTIL_VERSION := 0.5.14 UTIL_NAME := codeplag PWD := $(shell pwd) diff --git a/src/codeplag/__init__.py b/src/codeplag/__init__.py index 04ac6561..04cab3a6 100644 --- a/src/codeplag/__init__.py +++ b/src/codeplag/__init__.py @@ -30,13 +30,16 @@ def main() -> ExitCode: except KeyboardInterrupt: logger.warning("The util stopped by keyboard interrupt.") return ExitCode.EXIT_KEYBOARD - except Exception: + except Exception as error: logger.error( - "An unexpected error occurred while running the utility. " + "An unexpected error occurred while running the utility - %s. " "For getting more information, check file '%s'.", + error, LOG_PATH, ) - logger.debug("Trace:", exc_info=True) + stdout_handler = logger.handlers.pop() + logger.error("Trace:", exc_info=True) + logger.handlers.append(stdout_handler) return ExitCode.EXIT_UNKNOWN return code diff --git a/src/codeplag/utils.py b/src/codeplag/utils.py index 270c4331..42269377 100644 --- a/src/codeplag/utils.py +++ b/src/codeplag/utils.py @@ -5,6 +5,8 @@ from codeplag.consts import ( DEFAULT_MODE, + UTIL_NAME, + UTIL_VERSION, ) from codeplag.handlers.check import IgnoreThresholdWorksComparator, WorksComparator from codeplag.handlers.report import ( @@ -55,7 +57,7 @@ def __init__(self: Self, parsed_args: dict[str, Any]) -> None: self.directories: list[Path] = parsed_args.pop("directories", []) def run(self: Self) -> ExitCode: - logger.debug("Starting codeplag util ...") + logger.info("Starting %s util (%s) ...", UTIL_NAME, UTIL_VERSION) if self.root == "settings": if self.command == "show":