@@ -29,7 +29,7 @@ using namespace chip::app::Clusters::DiagnosticLogs;
29
29
LogProvider LogProvider::sInstance ;
30
30
LogProvider::CrashLogContext LogProvider::sCrashLogContext ;
31
31
32
- #if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
32
+ #ifdef CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
33
33
static uint32_t sReadEntries = 0 ;
34
34
static uint8_t retrievalBuffer[CONFIG_RETRIEVAL_BUFFER_SIZE];
35
35
#endif // CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
@@ -80,7 +80,7 @@ size_t LogProvider::GetSizeForIntent(IntentEnum intent)
80
80
switch (intent)
81
81
{
82
82
case IntentEnum::kEndUserSupport : {
83
- #if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
83
+ #ifdef CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
84
84
VerifyOrReturnError (mStorageInstance != nullptr , 0 ,
85
85
ChipLogError (DeviceLayer, " Diagnostic Storage instance cannot be null." ));
86
86
return mStorageInstance ->GetDataSize ();
@@ -120,7 +120,7 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE
120
120
switch (intent)
121
121
{
122
122
case IntentEnum::kEndUserSupport : {
123
- #if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
123
+ #ifdef CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
124
124
VerifyOrReturnError (mStorageInstance != nullptr , CHIP_ERROR_INTERNAL,
125
125
ChipLogError (DeviceLayer, " Diagnostic Storage instance cannot be null." ));
126
126
MutableByteSpan endUserSupportSpan (retrievalBuffer, CONFIG_RETRIEVAL_BUFFER_SIZE);
@@ -130,7 +130,7 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE
130
130
CHIP_ERROR err = mStorageInstance ->Retrieve (endUserSupportSpan, sReadEntries );
131
131
if (err != CHIP_NO_ERROR)
132
132
{
133
- ChipLogError (DeviceLayer, " Failed to retrieve data: %s " , chip::ErrorStr ( err));
133
+ ChipLogError (DeviceLayer, " Failed to retrieve data: %" CHIP_ERROR_FORMAT, err. Format ( ));
134
134
return err;
135
135
}
136
136
context->EndUserSupport .span = endUserSupportSpan;
@@ -318,7 +318,7 @@ CHIP_ERROR LogProvider::EndLogCollection(LogSessionHandle sessionHandle, CHIP_ER
318
318
}
319
319
else
320
320
{
321
- ChipLogProgress (DeviceLayer, " Cleared all read diagnostics successfully" );
321
+ ChipLogDetail (DeviceLayer, " Cleared all read diagnostics successfully" );
322
322
}
323
323
}
324
324
#endif // CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
0 commit comments