1
1
/*
2
2
*
3
- * Copyright (c) 2021 Project CHIP Authors
3
+ * Copyright (c) 2021-2022 Project CHIP Authors
4
4
* All rights reserved.
5
5
*
6
6
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -57,7 +57,7 @@ class TestPersistentStorageDelegate : public PersistentStorageDelegate
57
57
{
58
58
if (mLoggingLevel >= LoggingLevel::kLogMutationAndReads )
59
59
{
60
- ChipLogDetail (Test, " TestPersistentStorageDelegate::SyncGetKeyValue: Get key '%s'" , key);
60
+ ChipLogDetail (Test, " TestPersistentStorageDelegate::SyncGetKeyValue: Get key '%s'" , StringOrNullMarker ( key) );
61
61
}
62
62
63
63
CHIP_ERROR err = SyncGetKeyValueInternal (key, buffer, size);
@@ -66,11 +66,13 @@ class TestPersistentStorageDelegate : public PersistentStorageDelegate
66
66
{
67
67
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND)
68
68
{
69
- ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncGetKeyValue: Key '%s' not found" , key);
69
+ ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncGetKeyValue: Key '%s' not found" ,
70
+ StringOrNullMarker (key));
70
71
}
71
72
else if (err == CHIP_ERROR_PERSISTED_STORAGE_FAILED)
72
73
{
73
- ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncGetKeyValue: Key '%s' is a poison key" , key);
74
+ ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncGetKeyValue: Key '%s' is a poison key" ,
75
+ StringOrNullMarker (key));
74
76
}
75
77
}
76
78
@@ -91,7 +93,8 @@ class TestPersistentStorageDelegate : public PersistentStorageDelegate
91
93
{
92
94
if (err == CHIP_ERROR_PERSISTED_STORAGE_FAILED)
93
95
{
94
- ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncSetKeyValue: Key '%s' is a poison key" , key);
96
+ ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncSetKeyValue: Key '%s' is a poison key" ,
97
+ StringOrNullMarker (key));
95
98
}
96
99
}
97
100
@@ -102,19 +105,21 @@ class TestPersistentStorageDelegate : public PersistentStorageDelegate
102
105
{
103
106
if (mLoggingLevel >= LoggingLevel::kLogMutation )
104
107
{
105
- ChipLogDetail (Test, " TestPersistentStorageDelegate::SyncDeleteKeyValue, Delete key '%s'" , key);
108
+ ChipLogDetail (Test, " TestPersistentStorageDelegate::SyncDeleteKeyValue, Delete key '%s'" , StringOrNullMarker ( key) );
106
109
}
107
110
CHIP_ERROR err = SyncDeleteKeyValueInternal (key);
108
111
109
112
if (mLoggingLevel >= LoggingLevel::kLogMutation )
110
113
{
111
114
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND)
112
115
{
113
- ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncDeleteKeyValue: Key '%s' not found" , key);
116
+ ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncDeleteKeyValue: Key '%s' not found" ,
117
+ StringOrNullMarker (key));
114
118
}
115
119
else if (err == CHIP_ERROR_PERSISTED_STORAGE_FAILED)
116
120
{
117
- ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncDeleteKeyValue: Key '%s' is a poison key" , key);
121
+ ChipLogDetail (Test, " --> TestPersistentStorageDelegate::SyncDeleteKeyValue: Key '%s' is a poison key" ,
122
+ StringOrNullMarker (key));
118
123
}
119
124
}
120
125
0 commit comments