Skip to content

Commit

Permalink
add 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 10, 2025
1 parent 6004ed9 commit 5b30464
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/notificationconsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::queue<std::string>>();
while (true)
{
Expand Down Expand Up @@ -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 %ld", msg.c_str(), m_queue->size());
}

void swss::NotificationConsumer::pop(std::string &op, std::string &data, std::vector<FieldValueTuple> &values)
Expand All @@ -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<std::queue<std::string>>();
}
Expand Down

0 comments on commit 5b30464

Please sign in to comment.