[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log

pull/36879/head
tanvi-jagtap 9 months ago
parent e4b7d46f43
commit ba2d320d41
  1. 4
      test/core/address_utils/parse_address_with_named_scope_id_test.cc
  2. 3
      test/core/client_channel/client_channel_test.cc
  3. 2
      test/core/end2end/fixtures/http_proxy_fixture.cc
  4. 2
      test/core/iomgr/fd_posix_test.cc
  5. 3
      test/core/slice/slice_test.cc

@ -51,7 +51,7 @@ static void test_grpc_parse_ipv6_parity_with_getaddrinfo(
grpc_core::ExecCtx exec_ctx;
absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(target);
if (!uri.ok()) {
gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
LOG(ERROR) << uri.status();
ASSERT_TRUE(uri.ok());
}
grpc_resolved_address addr;
@ -75,7 +75,7 @@ static void test_grpc_parse_ipv6_parity_with_getaddrinfo(
struct sockaddr_in6 resolve_with_gettaddrinfo(const char* uri_text) {
absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(uri_text);
if (!uri.ok()) {
gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
LOG(ERROR) << uri.status();
EXPECT_TRUE(uri.ok());
}
std::string host;

@ -17,6 +17,7 @@
#include <atomic>
#include <memory>
#include "absl/log/log.h"
#include "absl/strings/string_view.h"
#include "gtest/gtest.h"
@ -106,7 +107,7 @@ class ClientChannelTest : public YodelTest {
RefCountedPtr<Subchannel> CreateSubchannel(
const grpc_resolved_address& address,
const ChannelArgs& args) override {
gpr_log(GPR_INFO, "CreateSubchannel: args=%s", args.ToString().c_str());
LOG(INFO) << "CreateSubchannel: args=" << args.ToString();
return Subchannel::Create(MakeOrphanable<TestConnector>(), address, args);
}
};

@ -208,7 +208,7 @@ static void on_read_request_done_locked(void* arg, grpc_error_handle error);
static void proxy_connection_failed(proxy_connection* conn,
failure_type failure, const char* prefix,
grpc_error_handle error) {
gpr_log(GPR_INFO, "%s: %s", prefix, grpc_core::StatusToString(error).c_str());
LOG(INFO) << prefix << ": " << grpc_core::StatusToString(error);
// Decide whether we should shut down the client and server.
bool shutdown_client = false;
bool shutdown_server = false;

@ -348,7 +348,7 @@ static void client_start(client* cl, int port) {
pfd.events = POLLOUT;
pfd.revents = 0;
if (poll(&pfd, 1, -1) == -1) {
gpr_log(GPR_ERROR, "poll() failed during connect; errno=%d", errno);
LOG(ERROR) << "poll() failed during connect; errno=" << errno;
abort();
}
} else {

@ -33,7 +33,6 @@
#include "gtest/gtest.h"
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/memory.h"
@ -402,7 +401,7 @@ TEST(SliceTest, ExternalAsOwned) {
// In ASAN (where we can be sure that it'll crash), go ahead and read the
// bytes we just deleted.
if (BuiltUnderAsan()) {
ASSERT_DEATH({ gpr_log(GPR_DEBUG, "%" PRIdPTR, SumSlice(slice)); }, "");
ASSERT_DEATH({ VLOG(2) << SumSlice(slice); }, "");
}
EXPECT_EQ(initial_sum, SumSlice(owned));
}

Loading…
Cancel
Save