From 68bfdef8692e2d1324f2a7ca34b72434e5892908 Mon Sep 17 00:00:00 2001 From: tanvi-jagtap Date: Mon, 8 Jul 2024 08:21:11 +0000 Subject: [PATCH] [Gpr_To_Absl_Logging] Fixing unit test that flags log noise --- src/core/util/log.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/core/util/log.cc b/src/core/util/log.cc index e29a7d7b930..726dde12c6e 100644 --- a/src/core/util/log.cc +++ b/src/core/util/log.cc @@ -115,15 +115,17 @@ void gpr_log_verbosity_init(void) { absl::string_view verbosity = grpc_core::ConfigVars::Get().Verbosity(); DVLOG(2) << "Log verbosity: " << verbosity; if (absl::EqualsIgnoreCase(verbosity, "INFO")) { - LOG(WARNING) << "Not suitable for production. Prefer WARNING or ERROR. " - "However if you see this message in a debug environmenmt " - "or test environmenmt it is safe to ignore this message."; + LOG_FIRST_N(WARNING, 1) + << "Not suitable for production. Prefer WARNING or ERROR. " + "However if you see this message in a debug environmenmt " + "or test environmenmt it is safe to ignore this message."; absl::SetVLogLevel("*grpc*/*", -1); absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfo); } else if (absl::EqualsIgnoreCase(verbosity, "DEBUG")) { - LOG(WARNING) << "Not suitable for production. Prefer WARNING or ERROR. " - "However if you see this message in a debug environmenmt " - "or test environmenmt it is safe to ignore this message."; + LOG_FIRST_N(WARNING, 1) + << "Not suitable for production. Prefer WARNING or ERROR. " + "However if you see this message in a debug environmenmt " + "or test environmenmt it is safe to ignore this message."; absl::SetVLogLevel("*grpc*/*", 2); absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfo); } else if (absl::EqualsIgnoreCase(verbosity, "ERROR")) {