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

pull/36860/head
tanvi-jagtap 6 months ago
parent a4df175240
commit 3a527448a3
  1. 3
      test/core/call/yodel/fuzzer_main.cc
  2. 3
      test/core/end2end/end2end_test_fuzzer.cc
  3. 3
      test/core/end2end/fuzzers/api_fuzzer.cc
  4. 3
      test/core/end2end/fuzzers/client_fuzzer.cc
  5. 3
      test/core/end2end/fuzzers/server_fuzzer.cc
  6. 3
      test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc
  7. 4
      test/core/nanopb/fuzzer_response.cc
  8. 4
      test/core/nanopb/fuzzer_serverlist.cc
  9. 3
      test/core/resource_quota/memory_quota_fuzzer.cc
  10. 3
      test/core/security/alts_credentials_fuzzer.cc
  11. 3
      test/core/security/ssl_server_fuzzer.cc
  12. 1
      test/core/test_util/BUILD
  13. 3
      test/core/test_util/test_config.cc
  14. 2
      test/core/test_util/test_config.h
  15. 3
      test/core/transport/binder/end2end/fuzzers/client_fuzzer.cc
  16. 3
      test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc
  17. 3
      test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
  18. 3
      test/core/transport/chttp2/hpack_sync_fuzzer.cc
  19. 3
      test/cpp/interop/metrics_client.cc

@ -31,6 +31,7 @@
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"
bool squelch = true;
@ -43,7 +44,7 @@ DEFINE_PROTO_FUZZER(const transport_test_suite::Msg& msg) {
const int test_id = msg.test_id() % tests->size();
if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_core::ConfigVars::Overrides overrides =

@ -43,6 +43,7 @@
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/test_config.h"
using ::grpc_event_engine::experimental::FuzzingEventEngine;
using ::grpc_event_engine::experimental::GetDefaultEventEngine;
@ -91,7 +92,7 @@ void RunEnd2endFuzzer(const core_end2end_test_fuzzer::Msg& msg) {
const int test_id = msg.test_id() % tests.size();
if (squelch && !GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
// TODO(ctiller): make this per fixture?

@ -69,6 +69,7 @@
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzzing_channel_args.h"
#include "test/core/test_util/test_config.h"
// IWYU pragma: no_include <google/protobuf/repeated_ptr_field.h>
@ -504,7 +505,7 @@ using grpc_core::testing::ApiFuzzer;
DEFINE_PROTO_FUZZER(const api_fuzzer::Msg& msg) {
if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_core::ApplyFuzzConfigVars(msg.config_vars());
grpc_core::TestOnlyReloadExperimentsFromConfigVariables();

@ -43,6 +43,7 @@
#include "test/core/end2end/fuzzers/network_input.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/mock_endpoint.h"
#include "test/core/test_util/test_config.h"
bool squelch = true;
bool leak_check = true;
@ -99,7 +100,7 @@ class ClientFuzzer final : public BasicFuzzer {
DEFINE_PROTO_FUZZER(const fuzzer_input::Msg& msg) {
if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
if (msg.network_input().size() != 1) return;
grpc_core::ApplyFuzzConfigVars(msg.config_vars());

@ -31,6 +31,7 @@
#include "test/core/end2end/fuzzers/fuzzing_common.h"
#include "test/core/end2end/fuzzers/network_input.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/test_config.h"
bool squelch = true;
bool leak_check = true;
@ -95,7 +96,7 @@ void RunServerFuzzer(
absl::FunctionRef<void(grpc_server*, int, const ChannelArgs&)>
server_setup) {
if (squelch && !GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
static const int once = []() {
ForceEnableExperiment("event_engine_client", true);

@ -48,6 +48,7 @@
#include "test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/fuzzing_channel_args.h"
#include "test/core/test_util/test_config.h"
bool squelch = true;
@ -254,7 +255,7 @@ grpc_core::ResolverArgs ConstructResolverArgs(
DEFINE_PROTO_FUZZER(const event_engine_client_channel_resolver::Msg& msg) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
bool done_resolving = false;
grpc_core::ApplyFuzzConfigVars(msg.config_vars());

@ -22,6 +22,8 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include "test/core/test_util/test_config.h"
bool squelch = true;
bool leak_check = true;
@ -29,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/,
size_t /*size*/) {
grpc_init();
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
// TODO(veblush): Convert this to upb.

@ -22,6 +22,8 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include "test/core/test_util/test_config.h"
bool squelch = true;
bool leak_check = true;
@ -29,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/,
size_t /*size*/) {
grpc_init();
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
// TODO(veblush): Convert this to upb.

@ -41,6 +41,7 @@
#include "test/core/resource_quota/call_checker.h"
#include "test/core/resource_quota/memory_quota_fuzzer.pb.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/test_config.h"
bool squelch = true;
bool leak_check = true;
@ -189,7 +190,7 @@ class Fuzzer {
DEFINE_PROTO_FUZZER(const memory_quota_fuzzer::Msg& msg) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_core::ApplyFuzzConfigVars(msg.config_vars());
grpc_core::TestOnlyReloadExperimentsFromConfigVariables();

@ -33,6 +33,7 @@
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
#include "test/core/test_util/fuzzer_util.h"
#include "test/core/test_util/test_config.h"
using grpc_core::testing::grpc_fuzzer_get_next_byte;
using grpc_core::testing::grpc_fuzzer_get_next_string;
@ -63,7 +64,7 @@ static void read_target_service_accounts(
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
input_stream inp = {data, data + size};
grpc_init();

@ -29,6 +29,7 @@
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/security_connector.h"
#include "test/core/test_util/mock_endpoint.h"
#include "test/core/test_util/test_config.h"
#include "test/core/test_util/tls_utils.h"
#define CA_CERT_PATH "src/core/tsi/test_creds/ca.pem"
@ -59,7 +60,7 @@ static void on_handshake_done(void* arg, grpc_error_handle error) {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_init();
{

@ -120,6 +120,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/debugging:failure_signal_handler",
"absl/log:check",
"absl/log:globals",
"absl/log:log",
"absl/status",
"absl/status:statusor",

@ -22,6 +22,7 @@
#include <stdlib.h>
#include "absl/debugging/failure_signal_handler.h"
#include "absl/log/globals.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/match.h"
@ -150,7 +151,7 @@ bool grpc_wait_until_shutdown(int64_t time_s) {
return true;
}
void gpr_disable_all_logs() {
void grpc_disable_all_absl_logs() {
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity);
absl::SetVLogLevel("*grpc*/*", -1);
}

@ -43,7 +43,7 @@ gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms);
void grpc_test_init(int* argc, char** argv);
// Disable all absl logs via SetMinLogLevel and SetVLogLevel
void gpr_disable_all_logs(void);
void grpc_disable_all_absl_logs(void);
// Wait until gRPC is fully shut down.
// Returns if grpc is shutdown

@ -27,6 +27,7 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/binder/end2end/fuzzers/binder_transport_fuzzer.pb.h"
#include "test/core/transport/binder/end2end/fuzzers/fuzzer_utils.h"
@ -37,7 +38,7 @@ static void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }
DEFINE_PROTO_FUZZER(const binder_transport_fuzzer::Input& input) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_init();
{

@ -22,6 +22,7 @@
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/server/server.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/binder/end2end/fuzzers/binder_transport_fuzzer.pb.h"
#include "test/core/transport/binder/end2end/fuzzers/fuzzer_utils.h"
@ -32,7 +33,7 @@ static void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }
DEFINE_PROTO_FUZZER(const binder_transport_fuzzer::Input& input) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_init();
{

@ -43,6 +43,7 @@
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/chttp2/hpack_parser_fuzzer.pb.h"
// IWYU pragma: no_include <google/protobuf/repeated_ptr_field.h>
@ -52,7 +53,7 @@ bool leak_check = true;
DEFINE_PROTO_FUZZER(const hpack_parser_fuzzer::Msg& msg) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_core::ProtoBitGen proto_bit_src(msg.random_numbers());
grpc_core::ApplyFuzzConfigVars(msg.config_vars());

@ -47,6 +47,7 @@
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/test_util/fuzz_config_vars.h"
#include "test/core/test_util/proto_bit_gen.h"
#include "test/core/test_util/test_config.h"
#include "test/core/transport/chttp2/hpack_sync_fuzzer.pb.h"
bool squelch = true;
@ -169,7 +170,7 @@ void FuzzOneInput(const hpack_sync_fuzzer::Msg& msg) {
DEFINE_PROTO_FUZZER(const hpack_sync_fuzzer::Msg& msg) {
if (squelch) {
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
}
grpc_core::ApplyFuzzConfigVars(msg.config_vars());
grpc_core::TestOnlyReloadExperimentsFromConfigVariables();

@ -27,6 +27,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/proto/grpc/testing/metrics.grpc.pb.h"
#include "src/proto/grpc/testing/metrics.pb.h"
#include "test/core/test_util/test_config.h"
#include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h"
@ -90,7 +91,7 @@ int main(int argc, char** argv) {
// The output of metrics client is in some cases programmatically parsed (for
// example by the stress test framework). So, we do not want any of the log
// from the grpc library appearing on stdout.
gpr_disable_all_logs();
grpc_disable_all_absl_logs();
std::shared_ptr<grpc::Channel> channel(
grpc::CreateChannel(absl::GetFlag(FLAGS_metrics_server_address),

Loading…
Cancel
Save