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

pull/36860/head
tanvi-jagtap 6 months ago
parent b1c3b5ddfe
commit a4df175240
  1. 1
      grpc.def
  2. 2
      include/grpc/support/log.h
  3. 5
      src/core/util/log.cc
  4. 2
      src/ruby/ext/grpc/rb_grpc_imports.generated.c
  5. 3
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  6. 5
      test/core/test_util/test_config.cc
  7. 3
      test/core/test_util/test_config.h

1
grpc.def generated

@ -236,7 +236,6 @@ EXPORTS
gpr_log_message
gpr_set_log_verbosity
gpr_log_verbosity_init
gpr_disable_all_logs
gpr_set_log_function
gpr_assertion_failed
gpr_format_message

@ -69,8 +69,6 @@ GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print);
GPRAPI void gpr_log_verbosity_init(void);
GPRAPI void gpr_disable_all_logs(void);
/** Log overrides: applications can use this API to intercept logging calls
and use their own implementations */

@ -187,8 +187,3 @@ void gpr_log_verbosity_init() {
void gpr_set_log_function(gpr_log_func f) {
gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)(f ? f : gpr_default_log));
}
void gpr_disable_all_logs() {
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity);
absl::SetVLogLevel("*grpc*/*", -1);
}

@ -259,7 +259,6 @@ gpr_should_log_type gpr_should_log_import;
gpr_log_message_type gpr_log_message_import;
gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
gpr_disable_all_logs_type gpr_disable_all_logs_import;
gpr_set_log_function_type gpr_set_log_function_import;
gpr_assertion_failed_type gpr_assertion_failed_import;
gpr_format_message_type gpr_format_message_import;
@ -550,7 +549,6 @@ void grpc_rb_load_imports(HMODULE library) {
gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message");
gpr_set_log_verbosity_import = (gpr_set_log_verbosity_type) GetProcAddress(library, "gpr_set_log_verbosity");
gpr_log_verbosity_init_import = (gpr_log_verbosity_init_type) GetProcAddress(library, "gpr_log_verbosity_init");
gpr_disable_all_logs_import = (gpr_disable_all_logs_type) GetProcAddress(library, "gpr_disable_all_logs");
gpr_set_log_function_import = (gpr_set_log_function_type) GetProcAddress(library, "gpr_set_log_function");
gpr_assertion_failed_import = (gpr_assertion_failed_type) GetProcAddress(library, "gpr_assertion_failed");
gpr_format_message_import = (gpr_format_message_type) GetProcAddress(library, "gpr_format_message");

@ -753,9 +753,6 @@ extern gpr_set_log_verbosity_type gpr_set_log_verbosity_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
typedef void(*gpr_disable_all_logs_type)(void);
extern gpr_disable_all_logs_type gpr_disable_all_logs_import;
#define gpr_disable_all_logs gpr_disable_all_logs_import
typedef void(*gpr_set_log_function_type)(gpr_log_func func);
extern gpr_set_log_function_type gpr_set_log_function_import;
#define gpr_set_log_function gpr_set_log_function_import

@ -150,6 +150,11 @@ bool grpc_wait_until_shutdown(int64_t time_s) {
return true;
}
void gpr_disable_all_logs() {
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity);
absl::SetVLogLevel("*grpc*/*", -1);
}
namespace grpc {
namespace testing {

@ -42,6 +42,9 @@ gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms);
// Prefer TestEnvironment below.
void grpc_test_init(int* argc, char** argv);
// Disable all absl logs via SetMinLogLevel and SetVLogLevel
void gpr_disable_all_logs(void);
// Wait until gRPC is fully shut down.
// Returns if grpc is shutdown
bool grpc_wait_until_shutdown(int64_t time_s);

Loading…
Cancel
Save