[Gpr_To_Absl_Logging] Remove gpr_log from grpc_call_log_batch (#37007)

[Gpr_To_Absl_Logging] Remove gpr_log from grpc_call_log_batch

Closes #37007

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37007 from tanvi-jagtap:grpc_call_log_batch_fix 84ffed71da
PiperOrigin-RevId: 645422467
pull/37017/head
Tanvi Jagtap 5 months ago committed by Copybara-Service
parent 1a3bcd0bda
commit 4d18248a82
  1. 15
      src/core/lib/surface/call.h
  2. 9
      src/core/lib/surface/call_log_batch.cc
  3. 17
      src/core/lib/surface/filter_stack_call.cc
  4. 4
      tools/run_tests/sanity/banned_functions.py

@ -31,7 +31,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/compression_types.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_fwd.h"
@ -269,18 +268,18 @@ void grpc_call_cancel_internal(grpc_call* call);
// Given the top call_element, get the call object.
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element);
void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
const grpc_op* ops, size_t nops);
void grpc_call_log_batch(const char* file, int line, const grpc_op* ops,
size_t nops);
void grpc_call_tracer_set(grpc_call* call, grpc_core::ClientCallTracer* tracer);
void* grpc_call_tracer_get(grpc_call* call);
#define GRPC_CALL_LOG_BATCH(sev, ops, nops) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(api)) { \
grpc_call_log_batch(sev, ops, nops); \
} \
#define GRPC_CALL_LOG_BATCH(ops, nops) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(api)) { \
grpc_call_log_batch(__FILE__, __LINE__, ops, nops); \
} \
} while (0)
uint8_t grpc_call_is_client(grpc_call* call);

@ -28,7 +28,6 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/slice/slice_internal.h"
@ -106,10 +105,10 @@ static std::string grpc_op_string(const grpc_op* op) {
return absl::StrJoin(parts, "");
}
void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
const grpc_op* ops, size_t nops) {
void grpc_call_log_batch(const char* file, int line, const grpc_op* ops,
size_t nops) {
for (size_t i = 0; i < nops; i++) {
gpr_log(file, line, severity, "ops[%" PRIuPTR "]: %s", i,
grpc_op_string(&ops[i]).c_str());
LOG(INFO).AtLocation(file, line)
<< "ops[" << i << "]: " << grpc_op_string(&ops[i]);
}
}

@ -41,7 +41,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>
@ -414,11 +413,10 @@ bool FilterStackCall::PrepareApplicationMetadata(size_t count,
}
batch->Append(StringViewFromSlice(md->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();
});
}
@ -749,13 +747,12 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops,
if (!is_client() &&
(seen_ops & (1u << GRPC_OP_SEND_STATUS_FROM_SERVER)) != 0 &&
(seen_ops & (1u << GRPC_OP_RECV_MESSAGE)) != 0) {
gpr_log(GPR_ERROR,
"******************* SEND_STATUS WITH RECV_MESSAGE "
"*******************");
LOG(ERROR) << "******************* SEND_STATUS WITH RECV_MESSAGE "
"*******************";
return GRPC_CALL_ERROR;
}
GRPC_CALL_LOG_BATCH(GPR_INFO, ops, nops);
GRPC_CALL_LOG_BATCH(ops, nops);
if (nops == 0) {
EndOpImmediately(cq_, notify_tag, is_notify_tag_closure);

@ -39,8 +39,6 @@ os.chdir(os.path.join(os.path.dirname(sys.argv[0]), "../../.."))
DEPRECATED_FUNCTION_TEMP_ALLOW_LIST = {
"gpr_log_severity": [
"./include/grpc/support/log.h",
"./src/core/lib/surface/call.h",
"./src/core/lib/surface/call_log_batch.cc",
"./src/core/util/android/log.cc",
"./src/core/util/linux/log.cc",
"./src/core/util/log.cc",
@ -154,11 +152,9 @@ DEPRECATED_FUNCTION_TEMP_ALLOW_LIST = {
"./src/core/lib/slice/slice_refcount.h",
"./src/core/lib/surface/api_trace.h",
"./src/core/lib/surface/call.cc",
"./src/core/lib/surface/call_log_batch.cc",
"./src/core/lib/surface/call_utils.cc",
"./src/core/lib/surface/channel_init.cc",
"./src/core/lib/surface/completion_queue.cc",
"./src/core/lib/surface/filter_stack_call.cc",
"./src/core/lib/surface/legacy_channel.cc",
"./src/core/lib/transport/bdp_estimator.cc",
"./src/core/lib/transport/bdp_estimator.h",

Loading…
Cancel
Save