Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #637 from didishe90/eventFailOrDropLog
Browse files Browse the repository at this point in the history
Add more logs to help debug event missing issue
  • Loading branch information
robszewczyk authored Jan 12, 2021
2 parents 1dd59be + f2c850a commit 18d4aef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,10 @@ event_id_t LoggingManagement::LogEvent(const EventSchema & inSchema, EventWriter

exit:
Platform::CriticalSectionExit();
if (event_id == 0)
{
WeaveLogProgress(EventLogging, "Failed to log event with ProfileId: %d, return event id 0", inSchema.mProfileId);
}
return event_id;
}

Expand Down Expand Up @@ -2229,7 +2233,9 @@ void CircularEventBuffer::AddEventUTC(utc_timestamp_t inEventTimestamp)

void CircularEventBuffer::RemoveEvent(size_t aNumEvents)
{
event_id_t currentFirstEventID = mFirstEventID;
mFirstEventID += aNumEvents;
WeaveLogDetail(EventLogging, "Dropping events | Move first event id from %u to %u", currentFirstEventID, mFirstEventID);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,8 @@ WEAVE_ERROR NotificationEngine::BuildSingleNotifyRequestEventList(SubscriptionHa
event_id_t tmp_id = logger.GetFirstEventID(static_cast<ImportanceType>(i + 1));
if (tmp_id > initialEvents[i])
{
WeaveLogProgress(DataManagement, "BuildSingleNotifyRequestEventList | Missing event_id range: { %u, %u };",
initialEvents[i], tmp_id - 1);
initialEvents[i] = tmp_id;
}
}
Expand Down Expand Up @@ -1342,6 +1344,8 @@ WEAVE_ERROR NotificationEngine::BuildSingleNotifyRequestEventList(SubscriptionHa
if (aSubHandler->mSelfVendedEvents[i] > initialEvents[i])
{
event_count += aSubHandler->mSelfVendedEvents[i] - initialEvents[i];
WeaveLogProgress(DataManagement, "Fetched events [importance: %d, event_id: %u - %u]",
i, initialEvents[i], aSubHandler->mSelfVendedEvents[i] - 1);
}
}

Expand Down

0 comments on commit 18d4aef

Please sign in to comment.