Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
Signed-off-by: Lawrence Lee <[email protected]>
  • Loading branch information
theasianpianist committed Jan 11, 2025
1 parent 729426d commit b0a1021
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/notificationconsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ swss::NotificationConsumer::NotificationConsumer(swss::DBConnector *db, const st
{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE("Creating notification consumer");
SWSS_LOG_NOTICE("Creating notification consumer for %s", m_channel.c_str());
m_queue = std::make_shared<std::queue<std::string>>();
while (true)
{
Expand Down Expand Up @@ -141,7 +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());
SWSS_LOG_INFO("%s queue size is %zu", m_channel.c_str(), m_queue->size());
}

void swss::NotificationConsumer::pop(std::string &op, std::string &data, std::vector<FieldValueTuple> &values)
Expand All @@ -166,7 +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");
SWSS_LOG_INFO("%s queue is empty, recreating", m_channel.c_str());
m_queue.reset();
m_queue = nullptr;
m_queue = std::make_shared<std::queue<std::string>>();
Expand Down

0 comments on commit b0a1021

Please sign in to comment.