From 925a4e4153990ec9fa1f8d295500a57554728b9e Mon Sep 17 00:00:00 2001 From: ggil Date: Mon, 2 Dec 2024 10:35:55 +0100 Subject: [PATCH] refs #631 - Modify logs in API and some scripts --- api/repo_api.py | 2 +- bin/runTorrentSeeder.py | 2 +- bin/runTorrentTracker.py | 2 +- bin/sendFileMcast.py | 2 +- bin/sendFileUFTP.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/repo_api.py b/api/repo_api.py index b6ce7f5..93c016e 100644 --- a/api/repo_api.py +++ b/api/repo_api.py @@ -383,7 +383,7 @@ def recall_ogcore(data): app.logger.info(f"HTTP Status Code: {response.status_code}") app.logger.info(f"HTTP Response: {response.text}") journal.send(f"HTTP Status Code: {response.status_code}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") - journal.send(f"HTTP Response: {response.text}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") + #journal.send(f"HTTP Response: {response.text}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") diff --git a/bin/runTorrentSeeder.py b/bin/runTorrentSeeder.py index 1aa2837..5c35619 100644 --- a/bin/runTorrentSeeder.py +++ b/bin/runTorrentSeeder.py @@ -46,7 +46,7 @@ def run_bittornado(repo_path): journal.send(f"runTorrentSeeder.py: Command ReturnCode: {result.returncode}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") print(f"Bittornado ReturnCode: {result.returncode}") except subprocess.CalledProcessError as error: - journal.send(f"runTorrentSeeder.py: Command error: {error}", PRIORITY=journal.LOG_ERR, SYSLOG_IDENTIFIER="ogrepo-api") + journal.send("runTorrentSeeder.py: Process finalized", PRIORITY=journal.LOG_WARNING, SYSLOG_IDENTIFIER="ogrepo-api") print(f"Bittornado ReturnCode: {error.returncode}") print(f"Bittornado Error Output: {error.stderr.decode()}") except Exception as error: diff --git a/bin/runTorrentTracker.py b/bin/runTorrentTracker.py index 2f278ba..8f05c44 100644 --- a/bin/runTorrentTracker.py +++ b/bin/runTorrentTracker.py @@ -54,7 +54,7 @@ def run_bttrack(repo_path): journal.send(f"runTorrentTracker.py: Command ReturnCode: {result.returncode}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") print(f"Bttrack ReturnCode: {result.returncode}") except subprocess.CalledProcessError as error: - journal.send(f"runTorrentTracker.py: Command error: {error}", PRIORITY=journal.LOG_ERR, SYSLOG_IDENTIFIER="ogrepo-api") + journal.send("runTorrentTracker.py: Process finalized", PRIORITY=journal.LOG_WARNING, SYSLOG_IDENTIFIER="ogrepo-api") print(f"Bttrack ReturnCode: {error.returncode}") print(f"Bttrack Error Output: {error.stderr.decode()}") except Exception as error: diff --git a/bin/sendFileMcast.py b/bin/sendFileMcast.py index 4153f6d..f5b378c 100644 --- a/bin/sendFileMcast.py +++ b/bin/sendFileMcast.py @@ -177,7 +177,7 @@ def main(): journal.send(f"sendFileMcast.py: Command ReturnCode: {result.returncode}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") print(f"ReturnCode: {result.returncode}") except subprocess.CalledProcessError as error: - journal.send(f"sendFileMcast.py: Command error: {error}", PRIORITY=journal.LOG_ERR, SYSLOG_IDENTIFIER="ogrepo-api") + journal.send("sendFileMcast.py: Process finalized", PRIORITY=journal.LOG_WARNING, SYSLOG_IDENTIFIER="ogrepo-api") print(f"ReturnCode: {error.returncode}") print(f"Error Output: {error.stderr.decode()}") except Exception as error: diff --git a/bin/sendFileUFTP.py b/bin/sendFileUFTP.py index ad9316b..8c10c0e 100644 --- a/bin/sendFileUFTP.py +++ b/bin/sendFileUFTP.py @@ -156,7 +156,7 @@ def main(): journal.send(f"sendFileUFTP.py: Command ReturnCode: {result.returncode}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api") print(f"ReturnCode: {result.returncode}") except subprocess.CalledProcessError as error: - journal.send(f"sendFileUFTP.py: Command error: {error}", PRIORITY=journal.LOG_ERR, SYSLOG_IDENTIFIER="ogrepo-api") + journal.send("sendFileUFTP.py: Process finalized", PRIORITY=journal.LOG_WARNING, SYSLOG_IDENTIFIER="ogrepo-api") print(f"ReturnCode: {error.returncode}") print(f"Error Output: {error.stderr.decode()}") except Exception as error: