Skip to content

Commit

Permalink
Fix MTRMetricsCollector.mm build failure using clang
Browse files Browse the repository at this point in the history
- Missing static_cast to int for enum class in a format string
  • Loading branch information
anush-apple committed Feb 27, 2024
1 parent d899019 commit 7d37a4f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/darwin/Framework/CHIP/MTRMetricsCollector.mm
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,19 @@ - (void)handleMetricEvent:(MetricEvent)event
using ValueType = MetricEvent::Value::Type;
switch (event.ValueType()) {
case ValueType::kInt32:
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), event.type(), event.ValueInt32());
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), static_cast<int>(event.type()), event.ValueInt32());
break;
case ValueType::kUInt32:
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), event.type(), event.ValueUInt32());
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), static_cast<int>(event.type()), event.ValueUInt32());
break;
case ValueType::kChipErrorCode:
MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), event.type(), event.ValueErrorCode());
MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), static_cast<int>(event.type()), event.ValueErrorCode());
break;
case ValueType::kUndefined:
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), event.type());
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), static_cast<int>(event.type()));
break;
default:
MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), event.type());
MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), static_cast<int>(event.type()));
return;
}

Expand Down

0 comments on commit 7d37a4f

Please sign in to comment.