diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index 78b79eb968e..642976a0e6b 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -30,7 +30,6 @@ #include "absl/strings/strip.h" #include -#include #include #include "src/core/lib/config/config_vars.h" @@ -41,7 +40,7 @@ int grpc_tracer_set_enabled(const char* name, int enabled); namespace grpc_core { namespace { void LogAllTracers() { - gpr_log(GPR_DEBUG, "available tracers:"); + VLOG(2) << "available tracers:"; for (const auto& name : GetAllTraceFlags()) { LOG(INFO) << " " << name.first; } diff --git a/src/core/lib/experiments/config.cc b/src/core/lib/experiments/config.cc index ca0ab151429..636be791dc4 100644 --- a/src/core/lib/experiments/config.cc +++ b/src/core/lib/experiments/config.cc @@ -24,12 +24,12 @@ #include "absl/functional/any_invocable.h" #include "absl/log/check.h" +#include "absl/log/log.h" #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/strings/strip.h" -#include #include #include "src/core/lib/config/config_vars.h" @@ -137,8 +137,7 @@ GPR_ATTRIBUTE_NOINLINE Experiments LoadExperimentsFromConfigVariableInner() { // If not found log an error, but don't take any other action. // Allows us an easy path to disabling experiments. if (!found) { - gpr_log(GPR_ERROR, "Unknown experiment: %s", - std::string(experiment).c_str()); + LOG(ERROR) << "Unknown experiment: " << experiment; } } for (size_t i = 0; i < kNumExperiments; i++) { @@ -227,19 +226,20 @@ void PrintExperimentsList() { } if (experiment_status.empty()) { if (!defaulted_on_experiments.empty()) { - gpr_log(GPR_INFO, "gRPC experiments enabled: %s", - absl::StrJoin(defaulted_on_experiments, ", ").c_str()); + LOG(INFO) << "gRPC experiments enabled: " + << absl::StrJoin(defaulted_on_experiments, ", "); } } else { if (defaulted_on_experiments.empty()) { - gpr_log(GPR_INFO, "gRPC experiments: %s", - absl::StrJoin(experiment_status, ", ", absl::PairFormatter(":")) - .c_str()); + LOG(INFO) << "gRPC experiments: " + << absl::StrJoin(experiment_status, ", ", + absl::PairFormatter(":")); } else { - gpr_log(GPR_INFO, "gRPC experiments: %s; default-enabled: %s", - absl::StrJoin(experiment_status, ", ", absl::PairFormatter(":")) - .c_str(), - absl::StrJoin(defaulted_on_experiments, ", ").c_str()); + LOG(INFO) << "gRPC experiments: " + << absl::StrJoin(experiment_status, ", ", + absl::PairFormatter(":")) + << "; default-enabled: " + << absl::StrJoin(defaulted_on_experiments, ", "); } } } @@ -256,8 +256,8 @@ void ForceEnableExperiment(absl::string_view experiment, bool enable) { } return; } - gpr_log(GPR_INFO, "gRPC EXPERIMENT %s not found to force %s", - std::string(experiment).c_str(), enable ? "enable" : "disable"); + LOG(INFO) << "gRPC EXPERIMENT " << experiment << " not found to force " + << (enable ? "enable" : "disable"); } void RegisterExperimentConstraintsValidator( diff --git a/tools/run_tests/sanity/banned_functions.py b/tools/run_tests/sanity/banned_functions.py index 2f390570fef..5f66731858a 100755 --- a/tools/run_tests/sanity/banned_functions.py +++ b/tools/run_tests/sanity/banned_functions.py @@ -95,7 +95,6 @@ BANNED_EXCEPT = { "./src/core/handshaker/http_connect/http_proxy_mapper.cc", "./src/core/handshaker/security/secure_endpoint.cc", "./src/core/lib/channel/channel_stack.cc", - "./src/core/lib/debug/trace.cc", "./src/core/lib/event_engine/ares_resolver.h", "./src/core/lib/event_engine/cf_engine/cf_engine.cc", "./src/core/lib/event_engine/posix_engine/posix_engine.cc",