From f416b31eec11c30ffbe53e3304d6d8cc0c9c29f6 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:27:12 -0700 Subject: [PATCH] [Gpr_To_Absl_Logging] Remove gpr_log_severity_string (#37013) [Gpr_To_Absl_Logging] Remove gpr_log_severity_string This function is not getting used anymore gpr_log_severity_string Closes #37013 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37013 from tanvi-jagtap:gpr_log_severity_string_remove 3346face4c1b5262e3af8f394f3c75729391ad6b PiperOrigin-RevId: 645796077 --- grpc.def | 1 - include/grpc/support/log.h | 3 --- src/core/util/log.cc | 12 ------------ src/ruby/ext/grpc/rb_grpc_imports.generated.c | 2 -- src/ruby/ext/grpc/rb_grpc_imports.generated.h | 3 --- tools/run_tests/sanity/banned_functions.py | 5 +---- 6 files changed, 1 insertion(+), 25 deletions(-) diff --git a/grpc.def b/grpc.def index 15a6591ef71..6679a51c5ca 100644 --- a/grpc.def +++ b/grpc.def @@ -230,7 +230,6 @@ EXPORTS gpr_free_aligned gpr_cpu_num_cores gpr_cpu_current_cpu - gpr_log_severity_string gpr_log gpr_should_log gpr_log_message diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index aa9e5dbd72f..7df1969f1b2 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -41,9 +41,6 @@ typedef enum gpr_log_severity { GPR_LOG_SEVERITY_ERROR } gpr_log_severity; -/** Returns a string representation of the log severity */ -GPRAPI const char* gpr_log_severity_string(gpr_log_severity severity); - /** Macros to build log contexts at various severity levels */ #define GPR_DEBUG __FILE__, __LINE__, GPR_LOG_SEVERITY_DEBUG #define GPR_INFO __FILE__, __LINE__, GPR_LOG_SEVERITY_INFO diff --git a/src/core/util/log.cc b/src/core/util/log.cc index 7cd0f574769..e29a7d7b930 100644 --- a/src/core/util/log.cc +++ b/src/core/util/log.cc @@ -44,18 +44,6 @@ void gpr_unreachable_code(const char* reason, const char* file, int line) { grpc_core::SourceLocation(file, line)); } -const char* gpr_log_severity_string(gpr_log_severity severity) { - switch (severity) { - case GPR_LOG_SEVERITY_DEBUG: - return "D"; - case GPR_LOG_SEVERITY_INFO: - return "I"; - case GPR_LOG_SEVERITY_ERROR: - return "E"; - } - GPR_UNREACHABLE_CODE(return "UNKNOWN"); -} - int gpr_should_log(gpr_log_severity severity) { switch (severity) { case GPR_LOG_SEVERITY_ERROR: diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index dff34366ce3..4bb5d2a91c9 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -253,7 +253,6 @@ gpr_malloc_aligned_type gpr_malloc_aligned_import; 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_severity_string_type gpr_log_severity_string_import; gpr_log_type gpr_log_import; gpr_should_log_type gpr_should_log_import; gpr_log_message_type gpr_log_message_import; @@ -542,7 +541,6 @@ void grpc_rb_load_imports(HMODULE library) { gpr_free_aligned_import = (gpr_free_aligned_type) GetProcAddress(library, "gpr_free_aligned"); 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_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string"); gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log"); gpr_should_log_import = (gpr_should_log_type) GetProcAddress(library, "gpr_should_log"); gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 4b0102c6860..36074841258 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -735,9 +735,6 @@ extern gpr_cpu_num_cores_type gpr_cpu_num_cores_import; typedef unsigned(*gpr_cpu_current_cpu_type)(void); extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import; #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import -typedef const char*(*gpr_log_severity_string_type)(gpr_log_severity severity); -extern gpr_log_severity_string_type gpr_log_severity_string_import; -#define gpr_log_severity_string gpr_log_severity_string_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 diff --git a/tools/run_tests/sanity/banned_functions.py b/tools/run_tests/sanity/banned_functions.py index 786dd52b845..b326185330b 100755 --- a/tools/run_tests/sanity/banned_functions.py +++ b/tools/run_tests/sanity/banned_functions.py @@ -48,10 +48,7 @@ DEPRECATED_FUNCTION_TEMP_ALLOW_LIST = { "./src/ruby/ext/grpc/rb_grpc_imports.generated.h", "./test/core/end2end/tests/no_logging.cc", ], - "gpr_log_severity_string(": [ - "./include/grpc/support/log.h", - "./src/core/util/log.cc", - ], + "gpr_log_severity_string": [], "gpr_log(": [ "./include/grpc/support/log.h", "./src/core/ext/filters/backend_metrics/backend_metric_filter.cc",