From 49f945e2bd89c2a30503440fc0855672d1f20af4 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:38:32 -0700 Subject: [PATCH] [Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#37147) [Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future. We have the following mapping 1. gpr_log(GPR_INFO,...) -> LOG(INFO) 2. gpr_log(GPR_ERROR,...) -> LOG(ERROR) 3. gpr_log(GPR_DEBUG,...) -> VLOG(2) Reviewers need to check : 1. If the above mapping is correct. 2. The content of the log is as before. gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected. Closes #37147 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37147 from tanvi-jagtap:event_engine_complex 779d86d41e17707656631db2810608ce86940c73 PiperOrigin-RevId: 649605515 --- src/core/lib/event_engine/ares_resolver.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/lib/event_engine/ares_resolver.h b/src/core/lib/event_engine/ares_resolver.h index 0182d0bef4e7d..68812e59a4cfa 100644 --- a/src/core/lib/event_engine/ares_resolver.h +++ b/src/core/lib/event_engine/ares_resolver.h @@ -47,11 +47,12 @@ namespace grpc_event_engine { namespace experimental { -#define GRPC_ARES_RESOLVER_TRACE_LOG(format, ...) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \ - gpr_log(GPR_INFO, "(EventEngine c-ares resolver) " format, __VA_ARGS__); \ - } \ +#define GRPC_ARES_RESOLVER_TRACE_LOG(format, ...) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \ + LOG(INFO) << "(EventEngine c-ares resolver) " \ + << absl::StrFormat(format, __VA_ARGS__); \ + } \ } while (0) class AresResolver : public RefCountedDNSResolverInterface {