From 43be6dd5710e7db00aaa70a1a9f7c23ca63ef9f8 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 31 Jan 2024 20:12:08 -0500 Subject: [PATCH] add/update logging --- msc_wis2node/publisher.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/msc_wis2node/publisher.py b/msc_wis2node/publisher.py index 1bd565c..f58623b 100644 --- a/msc_wis2node/publisher.py +++ b/msc_wis2node/publisher.py @@ -161,10 +161,10 @@ def publish_to_wis2(self, dataset: str, url: str) -> None: """ topic = f"{TOPIC_PREFIX}/{dataset['wis2-topic']}" - LOGGER.info(f'TOPIC: {topic}') + LOGGER.info(f'URL: {url}') datetime_ = self._topic_regex2datetime( - topic, dataset.get('msc-filename-datetime')) + url, dataset.get('msc-filename-datetime-regex')) message = create_message( identifier=str(uuid.uuid4()), @@ -180,8 +180,10 @@ def publish_to_wis2(self, dataset: str, url: str) -> None: tokens = data_id.split('/') message['properties']['data_id'] = '/'.join(tokens[2:]) - LOGGER.debug(json.dumps(message, indent=4)) - LOGGER.info('Publishing WIS2 notification message') + LOGGER.info(json.dumps(message, indent=4)) + msg = (f'Publishing WIS2 notification message to ' + f'host={BROKER_HOSTNAME}, port={BROKER_PORT}, topic={topic}') + LOGGER.info(msg) publish.single( topic,