Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Enhance server storage logs #9886

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/app/server/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,23 @@ class Server : public Messaging::ExchangeDelegate
{
CHIP_ERROR SyncGetKeyValue(const char * key, void * buffer, uint16_t & size) override
{
ChipLogProgress(AppServer, "Retrieved value from server storage.");
return DeviceLayer::PersistedStorage::KeyValueStoreMgr().Get(key, buffer, size);
ReturnErrorOnFailure(DeviceLayer::PersistedStorage::KeyValueStoreMgr().Get(key, buffer, size));
ChipLogProgress(AppServer, "Retrieved from server storage: %s", key);
return CHIP_NO_ERROR;
}

CHIP_ERROR SyncSetKeyValue(const char * key, const void * value, uint16_t size) override
{
ChipLogProgress(AppServer, "Stored value in server storage");
return DeviceLayer::PersistedStorage::KeyValueStoreMgr().Put(key, value, size);
ReturnErrorOnFailure(DeviceLayer::PersistedStorage::KeyValueStoreMgr().Put(key, value, size));
ChipLogProgress(AppServer, "Saved into server storage: %s", key);
return CHIP_NO_ERROR;
}

CHIP_ERROR SyncDeleteKeyValue(const char * key) override
{
ChipLogProgress(AppServer, "Delete value in server storage");
return DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(key);
ReturnErrorOnFailure(DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(key));
ChipLogProgress(AppServer, "Deleted from server storage: %s", key);
return CHIP_NO_ERROR;
}
};

Expand Down