[grpc][Gpr_To_Absl_Logging] Using absl from within gpr logging (#36108)

![Config_Vars_Absl (1)](https://github.com/grpc/grpc/assets/139093547/04d9b75c-dd1c-42ee-81a3-d20e2bbd5672)

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36108

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36108 from tanvi-jagtap:tjagtap_config_vars c48a3524f0
PiperOrigin-RevId: 615652000
pull/36119/head
Tanvi Jagtap 10 months ago committed by Copybara-Service
parent 424e95ccbb
commit 2c49416713
  1. 2
      BUILD
  2. 35
      CMakeLists.txt
  3. 13
      Makefile
  4. 2
      build_autogenerated.yaml
  5. 15
      config.m4
  6. 15
      config.w32
  7. 2
      gRPC-C++.podspec
  8. 2
      gRPC-Core.podspec
  9. 36
      grpc.gemspec
  10. 2
      grpc.gyp
  11. 36
      package.xml
  12. 10
      src/core/lib/config/config_vars.cc
  13. 4
      src/core/lib/config/config_vars.h
  14. 5
      src/core/lib/config/config_vars.yaml
  15. 2
      src/core/lib/gpr/android/log.cc
  16. 2
      src/core/lib/gpr/linux/log.cc
  17. 26
      src/core/lib/gpr/log.cc
  18. 2
      src/core/lib/gpr/posix/log.cc
  19. 2
      src/core/lib/gpr/windows/log.cc
  20. 13
      src/python/grpcio/grpc_core_dependencies.py
  21. 13
      src/python/grpcio_observability/observability_lib_deps.py
  22. 4
      test/core/util/fuzz_config_vars.cc

@ -746,7 +746,9 @@ grpc_cc_library(
external_deps = [
"absl/base",
"absl/base:core_headers",
"absl/base:log_severity",
"absl/functional:any_invocable",
"absl/log",
"absl/memory",
"absl/random",
"absl/status",

35
CMakeLists.txt generated

@ -97,6 +97,7 @@ set(gRPC_ABSL_PROVIDER "module" CACHE STRING "Provider of absl library")
set_property(CACHE gRPC_ABSL_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_ABSL_USED_TARGETS
absl_absl_vlog_is_on
absl_algorithm
absl_algorithm_container
absl_any_invocable
@ -135,6 +136,7 @@ set(gRPC_ABSL_USED_TARGETS
absl_dynamic_annotations
absl_endian
absl_errno_saver
absl_examine_stack
absl_exponential_biased
absl_fast_type_id
absl_fixed_array
@ -163,7 +165,26 @@ set(gRPC_ABSL_USED_TARGETS
absl_int128
absl_kernel_timeout_internal
absl_layout
absl_log
absl_log_entry
absl_log_globals
absl_log_internal_append_truncated
absl_log_internal_conditions
absl_log_internal_config
absl_log_internal_fnmatch
absl_log_internal_format
absl_log_internal_globals
absl_log_internal_log_impl
absl_log_internal_log_sink_set
absl_log_internal_message
absl_log_internal_nullguard
absl_log_internal_nullstream
absl_log_internal_proto
absl_log_internal_strip
absl_log_internal_voidify
absl_log_severity
absl_log_sink
absl_log_sink_registry
absl_low_level_hash
absl_malloc_internal
absl_memory
@ -221,6 +242,8 @@ set(gRPC_ABSL_USED_TARGETS
absl_type_traits
absl_utility
absl_variant
absl_vlog_config_internal
absl_vlog_is_on
absl_meta
)
@ -1714,9 +1737,11 @@ target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
absl::core_headers
absl::log_severity
absl::flags
absl::flags_marshalling
absl::any_invocable
absl::log
absl::memory
absl::random_random
absl::status
@ -36369,7 +36394,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_log absl_log_severity absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
""
"-lgpr"
""
@ -36380,7 +36405,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"libcares openssl re2 zlib"
"-lgrpc"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36391,7 +36416,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"libcares zlib"
"-lgrpc_unsecure"
"-laddress_sorting -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36402,7 +36427,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc"
"libcares openssl re2 zlib"
"-lgrpc++"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36413,7 +36438,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure"
"libcares zlib"
"-lgrpc++_unsecure"
"-laddress_sorting -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"

13
Makefile generated

@ -1539,6 +1539,7 @@ LIBGRPC_SRC = \
third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc \
third_party/abseil-cpp/absl/debugging/internal/demangle.cc \
third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc \
third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc \
third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc \
third_party/abseil-cpp/absl/debugging/stacktrace.cc \
third_party/abseil-cpp/absl/debugging/symbolize.cc \
@ -1553,6 +1554,18 @@ LIBGRPC_SRC = \
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
third_party/abseil-cpp/absl/log/globals.cc \
third_party/abseil-cpp/absl/log/internal/conditions.cc \
third_party/abseil-cpp/absl/log/internal/fnmatch.cc \
third_party/abseil-cpp/absl/log/internal/globals.cc \
third_party/abseil-cpp/absl/log/internal/log_format.cc \
third_party/abseil-cpp/absl/log/internal/log_message.cc \
third_party/abseil-cpp/absl/log/internal/log_sink_set.cc \
third_party/abseil-cpp/absl/log/internal/nullguard.cc \
third_party/abseil-cpp/absl/log/internal/proto.cc \
third_party/abseil-cpp/absl/log/internal/vlog_config.cc \
third_party/abseil-cpp/absl/log/log_entry.cc \
third_party/abseil-cpp/absl/log/log_sink.cc \
third_party/abseil-cpp/absl/numeric/int128.cc \
third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc \
third_party/abseil-cpp/absl/random/discrete_distribution.cc \

@ -125,9 +125,11 @@ libs:
deps:
- absl/base:base
- absl/base:core_headers
- absl/base:log_severity
- absl/flags:flag
- absl/flags:marshalling
- absl/functional:any_invocable
- absl/log:log
- absl/memory:memory
- absl/random:random
- absl/status:status

15
config.m4 generated

@ -924,6 +924,7 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc \
third_party/abseil-cpp/absl/debugging/internal/demangle.cc \
third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc \
third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc \
third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc \
third_party/abseil-cpp/absl/debugging/stacktrace.cc \
third_party/abseil-cpp/absl/debugging/symbolize.cc \
@ -938,6 +939,18 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
third_party/abseil-cpp/absl/log/globals.cc \
third_party/abseil-cpp/absl/log/internal/conditions.cc \
third_party/abseil-cpp/absl/log/internal/fnmatch.cc \
third_party/abseil-cpp/absl/log/internal/globals.cc \
third_party/abseil-cpp/absl/log/internal/log_format.cc \
third_party/abseil-cpp/absl/log/internal/log_message.cc \
third_party/abseil-cpp/absl/log/internal/log_sink_set.cc \
third_party/abseil-cpp/absl/log/internal/nullguard.cc \
third_party/abseil-cpp/absl/log/internal/proto.cc \
third_party/abseil-cpp/absl/log/internal/vlog_config.cc \
third_party/abseil-cpp/absl/log/log_entry.cc \
third_party/abseil-cpp/absl/log/log_sink.cc \
third_party/abseil-cpp/absl/numeric/int128.cc \
third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc \
third_party/abseil-cpp/absl/random/discrete_distribution.cc \
@ -1600,6 +1613,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/hash/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/log)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/log/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/numeric)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/profiling/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/random)

15
config.w32 generated

@ -889,6 +889,7 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\debugging\\internal\\address_is_readable.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\demangle.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\elf_mem_image.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\examine_stack.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\vdso_support.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\stacktrace.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\symbolize.cc " +
@ -903,6 +904,18 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\hash\\internal\\city.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\hash.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\low_level_hash.cc " +
"third_party\\abseil-cpp\\absl\\log\\globals.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\conditions.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\fnmatch.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\globals.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_format.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_message.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_sink_set.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\nullguard.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\proto.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\vlog_config.cc " +
"third_party\\abseil-cpp\\absl\\log\\log_entry.cc " +
"third_party\\abseil-cpp\\absl\\log\\log_sink.cc " +
"third_party\\abseil-cpp\\absl\\numeric\\int128.cc " +
"third_party\\abseil-cpp\\absl\\profiling\\internal\\exponential_biased.cc " +
"third_party\\abseil-cpp\\absl\\random\\discrete_distribution.cc " +
@ -1747,6 +1760,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\flags\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\log");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\log\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\numeric");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling\\internal");

2
gRPC-C++.podspec generated

@ -230,6 +230,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/base/log_severity', abseil_version
ss.dependency 'abseil/base/no_destructor', abseil_version
ss.dependency 'abseil/cleanup/cleanup', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
@ -241,6 +242,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version
ss.dependency 'abseil/random/bit_gen_ref', abseil_version

2
gRPC-Core.podspec generated

@ -200,6 +200,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/base/log_severity', abseil_version
ss.dependency 'abseil/base/no_destructor', abseil_version
ss.dependency 'abseil/cleanup/cleanup', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
@ -211,6 +212,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version
ss.dependency 'abseil/random/bit_gen_ref', abseil_version

36
grpc.gemspec generated

@ -2122,6 +2122,8 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/demangle.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/examine_stack.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h )
@ -2179,6 +2181,40 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/hash/internal/hash.h )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.h )
s.files += %w( third_party/abseil-cpp/absl/log/absl_vlog_is_on.h )
s.files += %w( third_party/abseil-cpp/absl/log/globals.cc )
s.files += %w( third_party/abseil-cpp/absl/log/globals.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/append_truncated.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/conditions.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/conditions.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/config.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/fnmatch.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/fnmatch.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/globals.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/globals.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_format.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_format.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_impl.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_message.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_message.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_sink_set.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_sink_set.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullguard.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullguard.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullstream.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/proto.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/proto.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/strip.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/vlog_config.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/vlog_config.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/voidify.h )
s.files += %w( third_party/abseil-cpp/absl/log/log.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_entry.cc )
s.files += %w( third_party/abseil-cpp/absl/log/log_entry.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink.cc )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink_registry.h )
s.files += %w( third_party/abseil-cpp/absl/log/vlog_is_on.h )
s.files += %w( third_party/abseil-cpp/absl/memory/memory.h )
s.files += %w( third_party/abseil-cpp/absl/meta/type_traits.h )
s.files += %w( third_party/abseil-cpp/absl/numeric/bits.h )

2
grpc.gyp generated

@ -194,9 +194,11 @@
'dependencies': [
'absl/base:base',
'absl/base:core_headers',
'absl/base:log_severity',
'absl/flags:flag',
'absl/flags:marshalling',
'absl/functional:any_invocable',
'absl/log:log',
'absl/memory:memory',
'absl/random:random',
'absl/status:status',

36
package.xml generated

@ -2126,6 +2126,8 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/demangle.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/examine_stack.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h" role="src" />
@ -2183,6 +2185,40 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/hash.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/absl_vlog_is_on.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/globals.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/globals.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/append_truncated.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/conditions.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/conditions.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/fnmatch.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/fnmatch.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/globals.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/globals.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_format.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_format.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_impl.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_message.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_message.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_sink_set.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_sink_set.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullguard.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullguard.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullstream.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/proto.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/proto.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/strip.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/vlog_config.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/vlog_config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/voidify.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_entry.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_entry.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink_registry.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/vlog_is_on.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/memory/memory.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/meta/type_traits.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/bits.h" role="src" />

@ -20,11 +20,8 @@
#include "src/core/lib/config/config_vars.h"
#include <vector>
#include "absl/flags/flag.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "src/core/lib/config/load_config.h"
@ -78,6 +75,8 @@ ABSL_FLAG(absl::optional<bool>, grpc_not_use_system_ssl_roots, {},
"Disable loading system root certificates.");
ABSL_FLAG(absl::optional<std::string>, grpc_ssl_cipher_suites, {},
"A colon separated list of cipher suites to use with OpenSSL");
ABSL_FLAG(absl::optional<bool>, grpc_absl_logging, {},
"Use absl logging from within gpr_log.");
namespace grpc_core {
@ -95,6 +94,8 @@ ConfigVars::ConfigVars(const Overrides& overrides)
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
absl_logging_(LoadConfig(FLAGS_grpc_absl_logging, "GRPC_ABSL_LOGGING",
overrides.absl_logging, false)),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
@ -146,7 +147,8 @@ std::string ConfigVars::ToString() const {
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"");
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"",
", absl_logging: ", AbslLogging() ? "true" : "false");
}
} // namespace grpc_core

@ -38,6 +38,7 @@ class GPR_DLL ConfigVars {
absl::optional<bool> enable_fork_support;
absl::optional<bool> abort_on_leaks;
absl::optional<bool> not_use_system_ssl_roots;
absl::optional<bool> absl_logging;
absl::optional<std::string> dns_resolver;
absl::optional<std::string> verbosity;
absl::optional<std::string> stacktrace_minloglevel;
@ -102,6 +103,8 @@ class GPR_DLL ConfigVars {
bool NotUseSystemSslRoots() const { return not_use_system_ssl_roots_; }
// A colon separated list of cipher suites to use with OpenSSL
absl::string_view SslCipherSuites() const { return ssl_cipher_suites_; }
// Use absl logging from within gpr_log.
bool AbslLogging() const { return absl_logging_; }
private:
explicit ConfigVars(const Overrides& overrides);
@ -111,6 +114,7 @@ class GPR_DLL ConfigVars {
bool enable_fork_support_;
bool abort_on_leaks_;
bool not_use_system_ssl_roots_;
bool absl_logging_;
std::string dns_resolver_;
std::string verbosity_;
std::string stacktrace_minloglevel_;

@ -126,3 +126,8 @@
ECDHE-ECDSA-AES256-GCM-SHA384:\
ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-RSA-AES256-GCM-SHA384"
- name: absl_logging
type: bool
default: false
description:
Use absl logging from within gpr_log.

@ -57,7 +57,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
free(message);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char* output = NULL;

@ -70,7 +70,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
free(message);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
#include "absl/log/log.h"
#include <stdio.h>
#include <string.h>
@ -40,6 +42,7 @@ 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;
void gpr_default_log(gpr_log_func_args* args);
void gpr_platform_log(gpr_log_func_args* args);
static gpr_atm g_log_func = reinterpret_cast<gpr_atm>(gpr_default_log);
static gpr_atm g_min_severity_to_print = GPR_LOG_SEVERITY_UNSET;
static gpr_atm g_min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_UNSET;
@ -73,6 +76,29 @@ int gpr_should_log(gpr_log_severity severity) {
: 0;
}
void gpr_default_log(gpr_log_func_args* args) {
if (!grpc_core::ConfigVars::Get().AbslLogging()) {
gpr_platform_log(args);
return;
}
switch (args->severity) {
case GPR_LOG_SEVERITY_DEBUG:
// Log DEBUG messages as VLOG(2).
VLOG(2).AtLocation(args->file, args->line) << args->message;
return;
case GPR_LOG_SEVERITY_INFO:
LOG(INFO).AtLocation(args->file, args->line) << args->message;
return;
case GPR_LOG_SEVERITY_ERROR:
LOG(ERROR).AtLocation(args->file, args->line) << args->message;
return;
default:
LOG(ERROR) << __func__ << ": unknown gpr log severity(" << args->severity
<< "), using ERROR";
LOG(ERROR).AtLocation(args->file, args->line) << args->message;
}
}
int gpr_should_log_stacktrace(gpr_log_severity severity) {
return static_cast<gpr_atm>(severity) >=
gpr_atm_no_barrier_load(&g_min_severity_to_print_stacktrace)

@ -70,7 +70,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
gpr_free(allocated);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -73,7 +73,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
}
// Simple starter implementation
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -888,6 +888,7 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc',
'third_party/abseil-cpp/absl/debugging/internal/demangle.cc',
'third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc',
'third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc',
'third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc',
'third_party/abseil-cpp/absl/debugging/stacktrace.cc',
'third_party/abseil-cpp/absl/debugging/symbolize.cc',
@ -902,6 +903,18 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/absl/hash/internal/city.cc',
'third_party/abseil-cpp/absl/hash/internal/hash.cc',
'third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc',
'third_party/abseil-cpp/absl/log/globals.cc',
'third_party/abseil-cpp/absl/log/internal/conditions.cc',
'third_party/abseil-cpp/absl/log/internal/fnmatch.cc',
'third_party/abseil-cpp/absl/log/internal/globals.cc',
'third_party/abseil-cpp/absl/log/internal/log_format.cc',
'third_party/abseil-cpp/absl/log/internal/log_message.cc',
'third_party/abseil-cpp/absl/log/internal/log_sink_set.cc',
'third_party/abseil-cpp/absl/log/internal/nullguard.cc',
'third_party/abseil-cpp/absl/log/internal/proto.cc',
'third_party/abseil-cpp/absl/log/internal/vlog_config.cc',
'third_party/abseil-cpp/absl/log/log_entry.cc',
'third_party/abseil-cpp/absl/log/log_sink.cc',
'third_party/abseil-cpp/absl/numeric/int128.cc',
'third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc',
'third_party/abseil-cpp/absl/random/discrete_distribution.cc',

@ -89,6 +89,7 @@ CC_FILES=[
'third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc',
'third_party/abseil-cpp/absl/debugging/internal/demangle.cc',
'third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc',
'third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc',
'third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc',
'third_party/abseil-cpp/absl/debugging/stacktrace.cc',
'third_party/abseil-cpp/absl/debugging/symbolize.cc',
@ -103,6 +104,18 @@ CC_FILES=[
'third_party/abseil-cpp/absl/hash/internal/city.cc',
'third_party/abseil-cpp/absl/hash/internal/hash.cc',
'third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc',
'third_party/abseil-cpp/absl/log/globals.cc',
'third_party/abseil-cpp/absl/log/internal/conditions.cc',
'third_party/abseil-cpp/absl/log/internal/fnmatch.cc',
'third_party/abseil-cpp/absl/log/internal/globals.cc',
'third_party/abseil-cpp/absl/log/internal/log_format.cc',
'third_party/abseil-cpp/absl/log/internal/log_message.cc',
'third_party/abseil-cpp/absl/log/internal/log_sink_set.cc',
'third_party/abseil-cpp/absl/log/internal/nullguard.cc',
'third_party/abseil-cpp/absl/log/internal/proto.cc',
'third_party/abseil-cpp/absl/log/internal/vlog_config.cc',
'third_party/abseil-cpp/absl/log/log_entry.cc',
'third_party/abseil-cpp/absl/log/log_sink.cc',
'third_party/abseil-cpp/absl/numeric/int128.cc',
'third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc',
'third_party/abseil-cpp/absl/random/discrete_distribution.cc',

@ -18,10 +18,6 @@
#include "test/core/util/fuzz_config_vars.h"
#include <string>
#include "absl/types/optional.h"
#include "test/core/util/fuzz_config_vars_helpers.h"
namespace grpc_core {

Loading…
Cancel
Save