From e0d6168cca7c5614f7b94ea08635ecbe2387e8cd Mon Sep 17 00:00:00 2001 From: Adam McDonagh Date: Mon, 21 Aug 2023 15:57:19 +0000 Subject: [PATCH] Logging update --- CHANGELOG.md | 4 ++++ src/opentaskpy/cli/task_run.py | 5 +---- src/opentaskpy/remotehandlers/sftp.py | 1 + src/opentaskpy/remotehandlers/ssh.py | 1 + src/opentaskpy/taskhandlers/transfer.py | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72e1888..74c8d0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# v0.14.2 + +- Minor log verbosity update + # v0.14.1 - Fix issue where port number is being ignored because the schema definition doesn't match the code that uses it. diff --git a/src/opentaskpy/cli/task_run.py b/src/opentaskpy/cli/task_run.py index c1a00d1..e57ae54 100644 --- a/src/opentaskpy/cli/task_run.py +++ b/src/opentaskpy/cli/task_run.py @@ -59,10 +59,7 @@ def main() -> None: parser.add_argument( "-v", "--verbosity", - help=( - "Increase verbosity:\n10 - DEBUG\n11 - VERBOSE1\n12 - VERBOSE2\n20 -" - " INFO\n30 - WARN\n40 - ERROR" - ), + help="Increase verbosity:\n3 - DEBUG\n2 - VERBOSE2\n1 - VERBOSE1", type=int, ) parser.add_argument( diff --git a/src/opentaskpy/remotehandlers/sftp.py b/src/opentaskpy/remotehandlers/sftp.py index 30e0e8b..15ec1af 100644 --- a/src/opentaskpy/remotehandlers/sftp.py +++ b/src/opentaskpy/remotehandlers/sftp.py @@ -333,6 +333,7 @@ def handle_post_copy_action(self, files: list[str]) -> int: for file in files: try: + self.logger.info(f"Deleting file {file}") self.sftp_client.remove(file) except OSError: self.logger.error( diff --git a/src/opentaskpy/remotehandlers/ssh.py b/src/opentaskpy/remotehandlers/ssh.py index 7d1667b..3c0068a 100644 --- a/src/opentaskpy/remotehandlers/ssh.py +++ b/src/opentaskpy/remotehandlers/ssh.py @@ -613,6 +613,7 @@ def handle_post_copy_action(self, files: list[str]) -> int: for file in files: try: + self.logger.info(f"Deleting file {file}") sftp_client.remove(file) except OSError: self.logger.error( diff --git a/src/opentaskpy/taskhandlers/transfer.py b/src/opentaskpy/taskhandlers/transfer.py index ed8d09d..10c6d0e 100644 --- a/src/opentaskpy/taskhandlers/transfer.py +++ b/src/opentaskpy/taskhandlers/transfer.py @@ -576,6 +576,7 @@ def run(self, kill_event: threading.Event | None = None) -> bool: # noqa: C901 if "postCopyAction" in self.source_file_spec: try: + self.logger.info("Performing post copy action") pca_result = self.source_remote_handler.handle_post_copy_action( remote_files )