[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36816)

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK.
These changes have been made using string replacement and regex.
Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.
Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

Closes #36816

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36816 from tanvi-jagtap:gpr_assert_removal 9db548beb0
PiperOrigin-RevId: 640731171
pull/36798/head^2
Tanvi Jagtap 9 months ago committed by Copybara-Service
parent 687b31d7c7
commit 8c6be41434
  1. 9
      src/cpp/ext/otel/otel_plugin.cc

@ -251,9 +251,8 @@ OpenTelemetryPlugin::CallbackMetricReporter::CallbackMetricReporter(
for (const auto& handle : key->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
CHECK(descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {
case grpc_core::GlobalInstrumentsRegistry::ValueType::kInt64: {
auto& callback_gauge_state =
@ -700,7 +699,7 @@ void OpenTelemetryPlugin::AddCallback(
for (const auto& handle : callback->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
CHECK(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {
@ -776,7 +775,7 @@ void OpenTelemetryPlugin::RemoveCallback(
for (const auto& handle : callback->metrics()) {
const auto& descriptor =
grpc_core::GlobalInstrumentsRegistry::GetInstrumentDescriptor(handle);
GPR_ASSERT(
CHECK(
descriptor.instrument_type ==
grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge);
switch (descriptor.value_type) {

Loading…
Cancel
Save