From a16664dd228cb3b7d84f5f102d717232a9a3312a Mon Sep 17 00:00:00 2001 From: Harris Tzovanakis Date: Tue, 20 Feb 2024 14:56:29 +0100 Subject: [PATCH] lns: logging message --- .../src/providers/library_newsletter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library-Notification-Service/src/providers/library_newsletter.py b/Library-Notification-Service/src/providers/library_newsletter.py index 4d1d91d..76bd076 100644 --- a/Library-Notification-Service/src/providers/library_newsletter.py +++ b/Library-Notification-Service/src/providers/library_newsletter.py @@ -1,5 +1,6 @@ """The command line module containing all the commands to filter documents.""" +import logging from typing import Tuple import click @@ -11,6 +12,8 @@ ) from ..utils import create_channel_message +logger = logging.getLogger(__name__) + @click.command() @click.option( @@ -61,6 +64,9 @@ def cli(subjects: Tuple[str, ...], title: str, target: str) -> None: if response.status_code == 200: click.echo("Notification sent successfully!") else: + logger.error( + f"Notification failed with status code: {response.status_code}:{response.text}" + ) click.echo( f"Notification failed with status code: {response.status_code}:{response.text}", err=True,