From 09a29d3b325b709538b84d487e7917a0aef20843 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Mon, 6 May 2024 04:53:39 -0700 Subject: [PATCH] [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36527) [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 #36527 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36527 from tanvi-jagtap:tjagtap_core_lib_surface_call 9700707155415baec81e7d8434c978a0d9f90331 PiperOrigin-RevId: 631005739 --- src/core/lib/surface/call.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index 2f0dce7ad6203..9fb12f279e4f4 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -24,6 +24,7 @@ #include "absl/functional/any_invocable.h" #include "absl/functional/function_ref.h" +#include "absl/log/check.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" @@ -162,8 +163,8 @@ class Call : public CppImplOf, arena_(arena), send_deadline_(send_deadline), is_client_(is_client) { - GPR_DEBUG_ASSERT(arena_ != nullptr); - GPR_DEBUG_ASSERT(channel_ != nullptr); + DCHECK_NE(arena_, nullptr); + DCHECK(channel_ != nullptr); } ~Call() override = default; @@ -172,7 +173,7 @@ class Call : public CppImplOf, ParentCall* GetOrCreateParentCall(); ParentCall* parent_call(); Channel* channel() const { - GPR_DEBUG_ASSERT(channel_ != nullptr); + DCHECK(channel_ != nullptr); return channel_.get(); }