[Gpr_To_Absl_Logging] Removing deprecated code.

1.  Function gpr_default_log has been deprecated. This function will be deleted in a few weeks.
1.  This entire unit test is being re-written as a part of another PR. But that PR will take a while to merge. In the mean team I want to delete all instances of this function to prevent further backsliding.
https://github.com/grpc/grpc/pull/37177

PiperOrigin-RevId: 654998772
pull/37272/head
Tanvi Jagtap 7 months ago committed by Copybara-Service
parent 28b678e853
commit 729847ab76
  1. 7
      test/core/end2end/tests/no_logging.cc

@ -35,8 +35,6 @@
#include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time.h"
#include "test/core/end2end/end2end_tests.h" #include "test/core/end2end/end2end_tests.h"
void gpr_default_log(gpr_log_func_args* args);
namespace grpc_core { namespace grpc_core {
// This test is currently broken. // This test is currently broken.
// The whole test will be re-written as a part of gpr to absl log conversion. // The whole test will be re-written as a part of gpr to absl log conversion.
@ -60,7 +58,6 @@ class Verifier {
} }
~Verifier() { ~Verifier() {
// This is broken. Replace with an absl log sink. // This is broken. Replace with an absl log sink.
gpr_set_log_function(gpr_default_log);
saved_trace_flags_.Restore(); saved_trace_flags_.Restore();
} }
Verifier(const Verifier&) = delete; Verifier(const Verifier&) = delete;
@ -90,12 +87,10 @@ class Verifier {
auto it = allowed_logs_by_module->find(filename); auto it = allowed_logs_by_module->find(filename);
if (it != allowed_logs_by_module->end() && if (it != allowed_logs_by_module->end() &&
std::regex_search(args->message, it->second)) { std::regex_search(args->message, it->second)) {
gpr_default_log(args);
return; return;
} }
std::string message = absl::StrCat("Unwanted log: ", args->message); std::string message = absl::StrCat("Unwanted log: ", args->message);
args->message = message.c_str(); args->message = message.c_str();
gpr_default_log(args);
GTEST_FAIL(); GTEST_FAIL();
} }
@ -110,7 +105,7 @@ class Verifier {
static std::atomic<gpr_log_func> g_log_func_; static std::atomic<gpr_log_func> g_log_func_;
}; };
std::atomic<gpr_log_func> Verifier::g_log_func_(gpr_default_log); std::atomic<gpr_log_func> Verifier::g_log_func_(NoErrorLog);
void SimpleRequest(CoreEnd2endTest& test) { void SimpleRequest(CoreEnd2endTest& test) {
auto c = test.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); auto c = test.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create();

Loading…
Cancel
Save