diff --git a/src/core/lib/config/config_vars.cc b/src/core/lib/config/config_vars.cc index b3a919b1170..c67f4463f0c 100644 --- a/src/core/lib/config/config_vars.cc +++ b/src/core/lib/config/config_vars.cc @@ -26,7 +26,7 @@ #include "src/core/lib/config/load_config.h" #ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING -#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR" +#define GPR_DEFAULT_LOG_VERBOSITY_STRING "" #endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING #ifdef GRPC_ENABLE_FORK_SUPPORT diff --git a/src/core/lib/config/config_vars.yaml b/src/core/lib/config/config_vars.yaml index 56e0e25d302..afedf2f7b9c 100644 --- a/src/core/lib/config/config_vars.yaml +++ b/src/core/lib/config/config_vars.yaml @@ -66,7 +66,7 @@ type: string prelude: | #ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING - #define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR" + #define GPR_DEFAULT_LOG_VERBOSITY_STRING "" #endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING default: $GPR_DEFAULT_LOG_VERBOSITY_STRING description: diff --git a/src/core/util/log.cc b/src/core/util/log.cc index 792fee6c550..4518f9eec0e 100644 --- a/src/core/util/log.cc +++ b/src/core/util/log.cc @@ -35,10 +35,6 @@ #include "src/core/lib/gprpp/crash.h" #include "src/core/util/string.h" -#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING -#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR" -#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING - static constexpr gpr_atm GPR_LOG_SEVERITY_UNSET = GPR_LOG_SEVERITY_ERROR + 10; static constexpr gpr_atm GPR_LOG_SEVERITY_NONE = GPR_LOG_SEVERITY_ERROR + 11; @@ -145,6 +141,9 @@ void gpr_to_absl_verbosity_setting_init(void) { } else if (absl::EqualsIgnoreCase(verbosity, "NONE")) { absl::SetVLogLevel("*grpc*/*", -1); absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity); + } else if (verbosity.empty()) { + // Do not set absl::MinLogLevel if verbosity has not been set. Note that the + // default gRPC min log severity that is printed will still be ERROR. } else { LOG(ERROR) << "Unknown log verbosity: " << verbosity; } diff --git a/tools/codegen/core/gen_config_vars.py b/tools/codegen/core/gen_config_vars.py index c2c46fa4338..1aa217a3ee3 100755 --- a/tools/codegen/core/gen_config_vars.py +++ b/tools/codegen/core/gen_config_vars.py @@ -219,8 +219,8 @@ with open("test/core/test_util/fuzz_config_vars.h", "w") as H: ], ) - print("#ifndef GRPC_TEST_CORE_UTIL_FUZZ_CONFIG_VARS_H", file=H) - print("#define GRPC_TEST_CORE_UTIL_FUZZ_CONFIG_VARS_H", file=H) + print("#ifndef GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H) + print("#define GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H) print(file=H) print("#include ", file=H) print(file=H) @@ -243,7 +243,7 @@ with open("test/core/test_util/fuzz_config_vars.h", "w") as H: print(file=H) print("} // namespace grpc_core", file=H) print(file=H) - print("#endif // GRPC_TEST_CORE_UTIL_FUZZ_CONFIG_VARS_H", file=H) + print("#endif // GRPC_TEST_CORE_TEST_UTIL_FUZZ_CONFIG_VARS_H", file=H) with open("test/core/test_util/fuzz_config_vars.cc", "w") as C: put_copyright(C)