[Gpr_To_Absl_Logging] Remove gpr_should_log from the header file (#37420)

[Gpr_To_Absl_Logging] Remove gpr_should_log from the header file

Closes #37420

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37420 from tanvi-jagtap:clean_up_ruby_php_01 ce303fa808
PiperOrigin-RevId: 661118631
pull/37428/head
Tanvi Jagtap 4 months ago committed by Copybara-Service
parent 8fe72e49b2
commit 83b56204c2
  1. 2
      grpc.def
  2. 3
      include/grpc/support/log.h
  3. 2
      src/core/ext/transport/binder/wire_format/wire_writer.cc
  4. 1
      src/core/util/android/log.cc
  5. 1
      src/core/util/linux/log.cc
  6. 2
      src/core/util/log.cc
  7. 1
      src/core/util/posix/log.cc
  8. 1
      src/core/util/windows/log.cc
  9. 2
      src/ruby/ext/grpc/rb_call_credentials.c
  10. 4
      src/ruby/ext/grpc/rb_grpc_imports.generated.c
  11. 6
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  12. 7
      tools/run_tests/sanity/banned_functions.py

2
grpc.def generated

@ -231,7 +231,7 @@ EXPORTS
gpr_cpu_num_cores
gpr_cpu_current_cpu
gpr_log
gpr_should_log
absl_vlog2_enabled
gpr_log_verbosity_init
gpr_format_message
gpr_strdup

@ -51,7 +51,8 @@ typedef enum gpr_log_severity {
GPRAPI void gpr_log(const char* file, int line, gpr_log_severity severity,
const char* format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
GPRAPI int gpr_should_log(gpr_log_severity severity);
/** Deprecated. **/
GPRAPI int absl_vlog2_enabled();
GPRAPI void gpr_log_verbosity_init(void);

@ -377,7 +377,7 @@ void WireWriterImpl::TryScheduleTransaction() {
} else {
// It is common to fill `kFlowControlWindowSize` completely because
// transactions are send at faster rate than the other end of transport
// can handle it, so here we use `GPR_DEBUG` log level.
// can handle it, so here we use VLOG(2).
VLOG(2) << "Some work cannot be scheduled yet due to slow ack from the "
"other end of transport. This transport might be blocked if "
"this number don't go down. pending_outgoing_tx_.size() = "

@ -30,6 +30,7 @@
#include "src/core/lib/gprpp/crash.h"
extern int gpr_should_log(gpr_log_severity severity);
extern void gpr_log_message(const char* file, int line,
gpr_log_severity severity, const char* message);

@ -47,6 +47,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/examine_stack.h"
extern int gpr_should_log(gpr_log_severity severity);
extern void gpr_log_message(const char* file, int line,
gpr_log_severity severity, const char* message);

@ -40,6 +40,8 @@ void gpr_unreachable_code(const char* reason, const char* file, int line) {
grpc_core::SourceLocation(file, line));
}
int absl_vlog2_enabled() { return ABSL_VLOG_IS_ON(2); }
int gpr_should_log(gpr_log_severity severity) {
switch (severity) {
case GPR_LOG_SEVERITY_ERROR:

@ -38,6 +38,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/examine_stack.h"
extern int gpr_should_log(gpr_log_severity severity);
extern void gpr_log_message(const char* file, int line,
gpr_log_severity severity, const char* message);

@ -33,6 +33,7 @@
#include "src/core/lib/gprpp/examine_stack.h"
#include "src/core/util/string.h"
extern int gpr_should_log(gpr_log_severity severity);
extern void gpr_log_message(const char* file, int line,
gpr_log_severity severity, const char* message);

@ -60,7 +60,7 @@ static VALUE grpc_rb_call_credentials_callback(VALUE args) {
VALUE callback_func = rb_ary_entry(args, 0);
VALUE callback_args = rb_ary_entry(args, 1);
VALUE md_ary_obj = rb_ary_entry(args, 2);
if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
if (absl_vlog2_enabled()) {
VALUE callback_func_str = rb_funcall(callback_func, rb_intern("to_s"), 0);
VALUE callback_args_str = rb_funcall(callback_args, rb_intern("to_s"), 0);
VALUE callback_source_info =

@ -254,7 +254,7 @@ gpr_free_aligned_type gpr_free_aligned_import;
gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
gpr_log_type gpr_log_import;
gpr_should_log_type gpr_should_log_import;
absl_vlog2_enabled_type absl_vlog2_enabled_import;
gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
gpr_format_message_type gpr_format_message_import;
gpr_strdup_type gpr_strdup_import;
@ -539,7 +539,7 @@ void grpc_rb_load_imports(HMODULE library) {
gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log");
gpr_should_log_import = (gpr_should_log_type) GetProcAddress(library, "gpr_should_log");
absl_vlog2_enabled_import = (absl_vlog2_enabled_type) GetProcAddress(library, "absl_vlog2_enabled");
gpr_log_verbosity_init_import = (gpr_log_verbosity_init_type) GetProcAddress(library, "gpr_log_verbosity_init");
gpr_format_message_import = (gpr_format_message_type) GetProcAddress(library, "gpr_format_message");
gpr_strdup_import = (gpr_strdup_type) GetProcAddress(library, "gpr_strdup");

@ -738,9 +738,9 @@ extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
typedef void(*gpr_log_type)(const char* file, int line, gpr_log_severity severity, const char* format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
extern gpr_log_type gpr_log_import;
#define gpr_log gpr_log_import
typedef int(*gpr_should_log_type)(gpr_log_severity severity);
extern gpr_should_log_type gpr_should_log_import;
#define gpr_should_log gpr_should_log_import
typedef int(*absl_vlog2_enabled_type)();
extern absl_vlog2_enabled_type absl_vlog2_enabled_import;
#define absl_vlog2_enabled absl_vlog2_enabled_import
typedef void(*gpr_log_verbosity_init_type)(void);
extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
#define gpr_log_verbosity_init gpr_log_verbosity_init_import

@ -37,6 +37,11 @@ os.chdir(os.path.join(os.path.dirname(sys.argv[0]), "../../.."))
# Map of deprecated functions to allowlist files
DEPRECATED_FUNCTION_TEMP_ALLOW_LIST = {
"absl_vlog2_enabled(": [
"./include/grpc/support/log.h",
"./src/core/util/log.cc",
"./src/ruby/ext/grpc/rb_call_credentials.c",
],
"gpr_log_severity": [
"./include/grpc/support/log.h",
"./src/core/util/android/log.cc",
@ -63,13 +68,11 @@ DEPRECATED_FUNCTION_TEMP_ALLOW_LIST = {
"./src/ruby/ext/grpc/rb_server.c",
],
"gpr_should_log(": [
"./include/grpc/support/log.h",
"./src/core/util/android/log.cc",
"./src/core/util/linux/log.cc",
"./src/core/util/log.cc",
"./src/core/util/posix/log.cc",
"./src/core/util/windows/log.cc",
"./src/ruby/ext/grpc/rb_call_credentials.c",
],
"gpr_log_message(": [
"./src/core/util/android/log.cc",

Loading…
Cancel
Save