Skip to content

Commit

Permalink
[#93] Fix logger formatting issue for enum class Failure with libfmt …
Browse files Browse the repository at this point in the history
…10.x (#96)

Co-authored-by: BjoernAtBosch <[email protected]>
  • Loading branch information
RaviprasadBS and BjoernAtBosch authored Jul 2, 2024
1 parent 93e6b40 commit 980084d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/src/sdk/grpc/GrpcDataPointValueProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const sdv::databroker::v1::Datapoint& GrpcDataPointValueProvider::getDataPoint()
}

DataPointValue::Failure GrpcDataPointValueProvider::getFailure() const {
if (!m_datapoint.has_failure_value()) {
return DataPointValue::Failure::NONE;
}

switch (m_datapoint.failure_value()) {
case sdv::databroker::v1::Datapoint_Failure_INVALID_VALUE:
return DataPointValue::Failure::INVALID_VALUE;
Expand All @@ -42,7 +46,7 @@ DataPointValue::Failure GrpcDataPointValueProvider::getFailure() const {
case sdv::databroker::v1::Datapoint_Failure_INTERNAL_ERROR:
return DataPointValue::Failure::INTERNAL_ERROR;
default:
logger().error("Unknown 'DataPointValue::Failure': {}", m_datapoint.failure_value());
logger().error("Unknown 'DataPointValue::Failure': {}", static_cast<int>(m_datapoint.failure_value()));
assert(false);
return DataPointValue::Failure::INTERNAL_ERROR;
}
Expand Down

0 comments on commit 980084d

Please sign in to comment.