[Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#37146)

[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 #37146

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37146 from tanvi-jagtap:src_core_lib_transport_surface 728c3dedb2
PiperOrigin-RevId: 649518102
pull/37147/head^2
Tanvi Jagtap 5 months ago committed by Copybara-Service
parent 98cd95cfce
commit 21ccffcc62
  1. 5
      src/core/BUILD
  2. 14
      src/core/lib/surface/call.cc
  3. 10
      src/core/lib/surface/call_utils.cc
  4. 12
      src/core/lib/surface/channel_init.cc
  5. 48
      src/core/lib/surface/completion_queue.cc
  6. 10
      src/core/lib/surface/legacy_channel.cc
  7. 16
      src/core/lib/transport/bdp_estimator.cc
  8. 10
      src/core/lib/transport/bdp_estimator.h
  9. 12
      src/core/lib/transport/call_filters.cc
  10. 53
      src/core/lib/transport/connectivity_state.cc
  11. 10
      src/core/lib/transport/transport.h

@ -7846,7 +7846,10 @@ grpc_cc_library(
hdrs = [
"lib/transport/call_filters.h",
],
external_deps = ["absl/log:check"],
external_deps = [
"absl/log:check",
"absl/log:log",
],
deps = [
"call_final_info",
"call_state",

@ -54,7 +54,6 @@
#include <grpc/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
@ -319,11 +318,9 @@ void Call::HandleCompressionAlgorithmNotAccepted(
grpc_compression_algorithm compression_algorithm) {
const char* algo_name = nullptr;
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
gpr_log(GPR_ERROR,
"Compression algorithm ('%s') not present in the "
"accepted encodings (%s)",
algo_name,
std::string(encodings_accepted_by_peer_.ToString()).c_str());
LOG(ERROR) << "Compression algorithm ('" << algo_name
<< "') not present in the accepted encodings ("
<< encodings_accepted_by_peer_.ToString() << ")";
}
void Call::HandleCompressionAlgorithmDisabled(
@ -341,8 +338,9 @@ void Call::HandleCompressionAlgorithmDisabled(
void Call::UpdateDeadline(Timestamp deadline) {
ReleasableMutexLock lock(&deadline_mu_);
if (GRPC_TRACE_FLAG_ENABLED(call)) {
gpr_log(GPR_DEBUG, "[call %p] UpdateDeadline from=%s to=%s", this,
deadline_.ToString().c_str(), deadline.ToString().c_str());
VLOG(2) << "[call " << this
<< "] UpdateDeadline from=" << deadline_.ToString()
<< " to=" << deadline.ToString();
}
if (deadline >= deadline_) return;
if (deadline < Timestamp::Now()) {

@ -28,6 +28,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -44,7 +45,6 @@
#include <grpc/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
@ -88,11 +88,9 @@ void CToMetadata(grpc_metadata* metadata, size_t count,
if (key == "content-length") continue;
b->Append(key, Slice(CSliceRef(md->value)),
[md](absl::string_view error, const Slice& value) {
gpr_log(GPR_DEBUG, "Append error: %s",
absl::StrCat("key=", StringViewFromSlice(md->key),
" error=", error,
" value=", value.as_string_view())
.c_str());
VLOG(2) << "Append error: key=" << StringViewFromSlice(md->key)
<< " error=" << error
<< " value=" << value.as_string_view();
});
}
}

@ -34,7 +34,6 @@
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/debug/trace.h"
@ -311,12 +310,11 @@ ChannelInit::StackConfig ChannelInit::BuildStackConfig(
// Right now it forces too many tests to know about channel initialization,
// either by supplying a valid configuration or by including an opt-out flag.
if (terminal_filters.empty() && type != GRPC_CLIENT_DYNAMIC) {
gpr_log(
GPR_ERROR,
"No terminal filters registered for channel stack type %s; this is "
"common for unit tests messing with CoreConfiguration, but will result "
"in a ChannelInit::CreateStack that never completes successfully.",
grpc_channel_stack_type_string(type));
LOG(ERROR) << "No terminal filters registered for channel stack type "
<< grpc_channel_stack_type_string(type)
<< "; this is common for unit tests messing with "
"CoreConfiguration, but will result in a "
"ChannelInit::CreateStack that never completes successfully.";
}
return StackConfig{std::move(filters), std::move(terminal_filters),
std::move(post_processor_functions)};

@ -36,7 +36,6 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
@ -438,14 +437,14 @@ static const cq_vtable g_cq_vtable[] = {
#define POLLSET_FROM_CQ(cq) \
((grpc_pollset*)((cq)->vtable->data_size + (char*)DATA_FROM_CQ(cq)))
#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(api) && \
(GRPC_TRACE_FLAG_ENABLED(queue_pluck) || \
(event)->type != GRPC_QUEUE_TIMEOUT)) { \
gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, \
grpc_event_string(event).c_str()); \
} \
#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(api) && \
(GRPC_TRACE_FLAG_ENABLED(queue_pluck) || \
(event)->type != GRPC_QUEUE_TIMEOUT)) { \
LOG(INFO) << "RETURN_EVENT[" << (cq) \
<< "]: " << grpc_event_string(event); \
} \
} while (0)
static void on_pollset_shutdown_done(void* arg, grpc_error_handle error);
@ -703,8 +702,7 @@ static void cq_end_op_for_next(
"done=%p, done_arg=%p, storage=%p)",
6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) {
gpr_log(GPR_INFO, "Operation failed: tag=%p, error=%s", tag,
errmsg.c_str());
LOG(INFO) << "Operation failed: tag=" << tag << ", error=" << errmsg;
}
}
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
@ -737,8 +735,8 @@ static void cq_end_op_for_next(
gpr_mu_unlock(cq->mu);
if (!kick_error.ok()) {
gpr_log(GPR_ERROR, "Kick failed: %s",
grpc_core::StatusToString(kick_error).c_str());
LOG(ERROR) << "Kick failed: "
<< grpc_core::StatusToString(kick_error);
}
}
if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
@ -777,8 +775,7 @@ static void cq_end_op_for_pluck(
"done=%p, done_arg=%p, storage=%p)",
6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) {
gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag,
errmsg.c_str());
LOG(ERROR) << "Operation failed: tag=" << tag << ", error=" << errmsg;
}
}
@ -813,8 +810,7 @@ static void cq_end_op_for_pluck(
cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), pluck_worker);
gpr_mu_unlock(cq->mu);
if (!kick_error.ok()) {
gpr_log(GPR_ERROR, "Kick failed: %s",
grpc_core::StatusToString(kick_error).c_str());
LOG(ERROR) << "Kick failed: " << kick_error;
}
}
}
@ -839,8 +835,7 @@ static void cq_end_op_for_callback(
"done=%p, done_arg=%p, storage=%p)",
6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) {
gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag,
errmsg.c_str());
LOG(ERROR) << "Operation failed: tag=" << tag << ", error=" << errmsg;
}
}
@ -1039,8 +1034,8 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
gpr_mu_unlock(cq->mu);
if (!err.ok()) {
gpr_log(GPR_ERROR, "Completion queue next failed: %s",
grpc_core::StatusToString(err).c_str());
LOG(ERROR) << "Completion queue next failed: "
<< grpc_core::StatusToString(err);
if (err == absl::CancelledError()) {
ret.type = GRPC_QUEUE_SHUTDOWN;
} else {
@ -1253,10 +1248,9 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
break;
}
if (!add_plucker(cq, tag, &worker)) {
gpr_log(GPR_DEBUG,
"Too many outstanding grpc_completion_queue_pluck calls: maximum "
"is %d",
GRPC_MAX_COMPLETION_QUEUE_PLUCKERS);
VLOG(2) << "Too many outstanding grpc_completion_queue_pluck calls: "
"maximum is "
<< GRPC_MAX_COMPLETION_QUEUE_PLUCKERS;
gpr_mu_unlock(cq->mu);
// TODO(ctiller): should we use a different result here
ret.type = GRPC_QUEUE_TIMEOUT;
@ -1279,8 +1273,8 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
if (!err.ok()) {
del_plucker(cq, tag, &worker);
gpr_mu_unlock(cq->mu);
gpr_log(GPR_ERROR, "Completion queue pluck failed: %s",
grpc_core::StatusToString(err).c_str());
LOG(ERROR) << "Completion queue pluck failed: "
<< grpc_core::StatusToString(err);
ret.type = GRPC_QUEUE_TIMEOUT;
ret.success = 0;
dump_pending_tags(cq);

@ -20,6 +20,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"
@ -27,7 +28,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"
@ -86,8 +86,7 @@ absl::StatusOr<RefCountedPtr<Channel>> LegacyChannel::Create(
absl::StatusOr<RefCountedPtr<grpc_channel_stack>> r = builder.Build();
if (!r.ok()) {
auto status = r.status();
gpr_log(GPR_ERROR, "channel stack builder failed: %s",
status.ToString().c_str());
LOG(ERROR) << "channel stack builder failed: " << status;
return status;
}
if (channel_stack_type == GRPC_SERVER_CHANNEL) {
@ -210,9 +209,8 @@ grpc_connectivity_state LegacyChannel::CheckConnectivityState(
ClientChannelFilter* client_channel = GetClientChannelFilter();
if (GPR_UNLIKELY(client_channel == nullptr)) {
if (IsLame()) return GRPC_CHANNEL_TRANSIENT_FAILURE;
gpr_log(GPR_ERROR,
"grpc_channel_check_connectivity_state called on something that is "
"not a client channel");
LOG(ERROR) << "grpc_channel_check_connectivity_state called on something "
"that is not a client channel";
return GRPC_CHANNEL_SHUTDOWN;
}
return client_channel->CheckConnectivityState(try_to_connect);

@ -24,6 +24,7 @@
#include <algorithm>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/port_platform.h>
@ -47,19 +48,16 @@ Timestamp BdpEstimator::CompletePing() {
double bw = dt > 0 ? (static_cast<double>(accumulator_) / dt) : 0;
Duration start_inter_ping_delay = inter_ping_delay_;
if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) {
gpr_log(GPR_INFO,
"bdp[%s]:complete acc=%" PRId64 " est=%" PRId64
" dt=%lf bw=%lfMbs bw_est=%lfMbs",
std::string(name_).c_str(), accumulator_, estimate_, dt,
bw / 125000.0, bw_est_ / 125000.0);
LOG(INFO) << "bdp[" << name_ << "]:complete acc=" << accumulator_
<< " est=" << estimate_ << " dt=" << dt << " bw=" << bw / 125000.0
<< "Mbs bw_est=" << bw_est_ / 125000.0 << "Mbs";
}
CHECK(ping_state_ == PingState::STARTED);
if (accumulator_ > 2 * estimate_ / 3 && bw > bw_est_) {
estimate_ = std::max(accumulator_, estimate_ * 2);
bw_est_ = bw;
if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) {
gpr_log(GPR_INFO, "bdp[%s]: estimate increased to %" PRId64,
std::string(name_).c_str(), estimate_);
LOG(INFO) << "bdp[" << name_ << "]: estimate increased to " << estimate_;
}
inter_ping_delay_ /= 2; // if the ping estimate changes,
// exponentially get faster at probing
@ -74,8 +72,8 @@ Timestamp BdpEstimator::CompletePing() {
if (start_inter_ping_delay != inter_ping_delay_) {
stable_estimate_count_ = 0;
if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) {
gpr_log(GPR_INFO, "bdp[%s]:update_inter_time to %" PRId64 "ms",
std::string(name_).c_str(), inter_ping_delay_.millis());
LOG(INFO) << "bdp[" << name_ << "]:update_inter_time to "
<< inter_ping_delay_.millis() << "ms";
}
}
ping_state_ = PingState::UNSCHEDULED;

@ -24,9 +24,9 @@
#include <string>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/string_view.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
@ -50,8 +50,8 @@ class BdpEstimator {
// transport (but not necessarily started)
void SchedulePing() {
if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) {
gpr_log(GPR_INFO, "bdp[%s]:sched acc=%" PRId64 " est=%" PRId64,
std::string(name_).c_str(), accumulator_, estimate_);
LOG(INFO) << "bdp[" << name_ << "]:sched acc=" << accumulator_
<< " est=" << estimate_;
}
CHECK(ping_state_ == PingState::UNSCHEDULED);
ping_state_ = PingState::SCHEDULED;
@ -63,8 +63,8 @@ class BdpEstimator {
// the ping is on the wire
void StartPing() {
if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) {
gpr_log(GPR_INFO, "bdp[%s]:start acc=%" PRId64 " est=%" PRId64,
std::string(name_).c_str(), accumulator_, estimate_);
LOG(INFO) << "bdp[" << name_ << "]:start acc=" << accumulator_
<< " est=" << estimate_;
}
CHECK(ping_state_ == PingState::SCHEDULED);
ping_state_ = PingState::STARTED;

@ -15,6 +15,7 @@
#include "src/core/lib/transport/call_filters.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/port_platform.h>
@ -188,9 +189,8 @@ void CallFilters::CancelDueToFailedPipeOperation(SourceLocation but_where) {
// We expect something cancelled before now
if (push_server_trailing_metadata_ == nullptr) return;
if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) {
gpr_log(but_where.file(), but_where.line(), GPR_LOG_SEVERITY_DEBUG,
"Cancelling due to failed pipe operation: %s",
DebugString().c_str());
VLOG(2).AtLocation(but_where.file(), but_where.line())
<< "Cancelling due to failed pipe operation: " << DebugString();
}
auto status =
ServerMetadataFromStatus(absl::CancelledError("Failed pipe operation"));
@ -201,9 +201,9 @@ void CallFilters::CancelDueToFailedPipeOperation(SourceLocation but_where) {
void CallFilters::PushServerTrailingMetadata(ServerMetadataHandle md) {
CHECK(md != nullptr);
if (GRPC_TRACE_FLAG_ENABLED(call)) {
gpr_log(GPR_INFO, "%s PushServerTrailingMetadata[%p]: %s into %s",
GetContext<Activity>()->DebugTag().c_str(), this,
md->DebugString().c_str(), DebugString().c_str());
LOG(INFO) << GetContext<Activity>()->DebugTag()
<< " PushServerTrailingMetadata[" << this
<< "]: " << md->DebugString() << " into " << DebugString();
}
CHECK(md != nullptr);
if (call_state_.PushServerTrailingMetadata(

@ -18,7 +18,8 @@
#include "src/core/lib/transport/connectivity_state.h"
#include <grpc/support/log.h>
#include "absl/log/log.h"
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/debug_location.h"
@ -72,9 +73,10 @@ class AsyncConnectivityStateWatcherInterface::Notifier {
static void SendNotification(void* arg, grpc_error_handle /*ignored*/) {
Notifier* self = static_cast<Notifier*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO, "watcher %p: delivering async notification for %s (%s)",
self->watcher_.get(), ConnectivityStateName(self->state_),
self->status_.ToString().c_str());
LOG(INFO) << "watcher " << self->watcher_.get()
<< ": delivering async notification for "
<< ConnectivityStateName(self->state_) << " ("
<< self->status_.ToString() << ")";
}
self->watcher_->OnConnectivityStateChange(self->state_, self->status_);
delete self;
@ -103,10 +105,10 @@ ConnectivityStateTracker::~ConnectivityStateTracker() {
if (current_state == GRPC_CHANNEL_SHUTDOWN) return;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO,
"ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
name_, this, p.first, ConnectivityStateName(current_state),
ConnectivityStateName(GRPC_CHANNEL_SHUTDOWN));
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: notifying watcher " << p.first << ": "
<< ConnectivityStateName(current_state) << " -> "
<< ConnectivityStateName(GRPC_CHANNEL_SHUTDOWN);
}
p.second->Notify(GRPC_CHANNEL_SHUTDOWN, absl::Status());
}
@ -116,17 +118,17 @@ void ConnectivityStateTracker::AddWatcher(
grpc_connectivity_state initial_state,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) {
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: add watcher %p", name_,
this, watcher.get());
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: add watcher " << watcher.get();
}
grpc_connectivity_state current_state =
state_.load(std::memory_order_relaxed);
if (initial_state != current_state) {
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO,
"ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
name_, this, watcher.get(), ConnectivityStateName(initial_state),
ConnectivityStateName(current_state));
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: notifying watcher " << watcher.get() << ": "
<< ConnectivityStateName(initial_state) << " -> "
<< ConnectivityStateName(current_state);
}
watcher->Notify(current_state, status_);
}
@ -140,8 +142,8 @@ void ConnectivityStateTracker::AddWatcher(
void ConnectivityStateTracker::RemoveWatcher(
ConnectivityStateWatcherInterface* watcher) {
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: remove watcher %p",
name_, this, watcher);
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: remove watcher " << watcher;
}
watchers_.erase(watcher);
}
@ -153,18 +155,19 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
state_.load(std::memory_order_relaxed);
if (state == current_state) return;
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)",
name_, this, ConnectivityStateName(current_state),
ConnectivityStateName(state), reason, status.ToString().c_str());
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: " << ConnectivityStateName(current_state) << " -> "
<< ConnectivityStateName(state) << " (" << reason << ", "
<< status.ToString() << ")";
}
state_.store(state, std::memory_order_relaxed);
status_ = status;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO,
"ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s",
name_, this, p.first, ConnectivityStateName(current_state),
ConnectivityStateName(state));
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: notifying watcher " << p.first << ": "
<< ConnectivityStateName(current_state) << " -> "
<< ConnectivityStateName(state);
}
p.second->Notify(state, status);
}
@ -176,8 +179,8 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
grpc_connectivity_state ConnectivityStateTracker::state() const {
grpc_connectivity_state state = state_.load(std::memory_order_relaxed);
if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: get current state: %s",
name_, this, ConnectivityStateName(state));
LOG(INFO) << "ConnectivityStateTracker " << name_ << "[" << this
<< "]: get current state: " << ConnectivityStateName(state);
}
return state;
}

@ -28,6 +28,7 @@
#include <utility>
#include "absl/functional/any_invocable.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
@ -35,7 +36,6 @@
#include <grpc/impl/connectivity_state.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
@ -191,8 +191,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
inline void grpc_stream_ref(grpc_stream_refcount* refcount,
const char* reason) {
if (GRPC_TRACE_FLAG_ENABLED(stream_refcount)) {
gpr_log(GPR_DEBUG, "%s %p:%p REF %s", refcount->object_type, refcount,
refcount->destroy.cb_arg, reason);
VLOG(2) << refcount->object_type << " " << refcount << ":"
<< refcount->destroy.cb_arg << " REF " << reason;
}
refcount->refs.RefNonZero(DEBUG_LOCATION, reason);
}
@ -208,8 +208,8 @@ void grpc_stream_destroy(grpc_stream_refcount* refcount);
inline void grpc_stream_unref(grpc_stream_refcount* refcount,
const char* reason) {
if (GRPC_TRACE_FLAG_ENABLED(stream_refcount)) {
gpr_log(GPR_DEBUG, "%s %p:%p UNREF %s", refcount->object_type, refcount,
refcount->destroy.cb_arg, reason);
VLOG(2) << refcount->object_type << " " << refcount << ":"
<< refcount->destroy.cb_arg << " UNREF " << reason;
}
if (GPR_UNLIKELY(refcount->refs.Unref(DEBUG_LOCATION, reason))) {
grpc_stream_destroy(refcount);

Loading…
Cancel
Save