From 8091aca41fd4f445c8921a1d3460874cb132d690 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 10 Jan 2025 20:19:21 +0000 Subject: [PATCH] add logging Signed-off-by: Lawrence Lee --- common/notificationconsumer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/notificationconsumer.cpp b/common/notificationconsumer.cpp index 501d7a54c..5a31aa193 100644 --- a/common/notificationconsumer.cpp +++ b/common/notificationconsumer.cpp @@ -17,6 +17,7 @@ swss::NotificationConsumer::NotificationConsumer(swss::DBConnector *db, const st { SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Creating notification consumer"); m_queue = std::make_shared>(); while (true) { @@ -140,6 +141,7 @@ void swss::NotificationConsumer::processReply(redisReply *reply) SWSS_LOG_DEBUG("got message: %s", msg.c_str()); m_queue->push(msg); + SWSS_LOG_INFO("got message: %s, queue size is %zu", msg.c_str(), m_queue->size()); } void swss::NotificationConsumer::pop(std::string &op, std::string &data, std::vector &values) @@ -164,6 +166,7 @@ void swss::NotificationConsumer::pop(std::string &op, std::string &data, std::ve * * Force the memory to be released by destroying existing queue and creating a new one. */ + SWSS_LOG_INFO("Queue is empty, recreating"); m_queue = nullptr; m_queue = std::make_shared>(); }