diff --git a/BUILD b/BUILD index 617bc1cf533..747f134371c 100644 --- a/BUILD +++ b/BUILD @@ -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", diff --git a/CMakeLists.txt b/CMakeLists.txt index 10a84fbc767..afaffdda098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" diff --git a/Makefile b/Makefile index 23f195b095a..a6fb5f7ddc3 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 0ef8f449446..8f3765d9398 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -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 diff --git a/config.m4 b/config.m4 index 71180188c82..0e5da21558c 100644 --- a/config.m4 +++ b/config.m4 @@ -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) diff --git a/config.w32 b/config.w32 index b9e6c920b2e..0dea3cdcccf 100644 --- a/config.w32 +++ b/config.w32 @@ -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"); diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index f459d1b7b85..b8e6e3d892b 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -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 diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index dd30ea8829c..67f256a60e3 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -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 diff --git a/grpc.gemspec b/grpc.gemspec index 64b5cf62e4b..1016f7ed774 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -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 ) diff --git a/grpc.gyp b/grpc.gyp index df31e5f4f3b..eb70fc54080 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -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', diff --git a/package.xml b/package.xml index 84621351c14..c31c71f176b 100644 --- a/package.xml +++ b/package.xml @@ -2126,6 +2126,8 @@ + + @@ -2183,6 +2185,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/lib/config/config_vars.cc b/src/core/lib/config/config_vars.cc index 75b56d344c7..c13c6c6d81e 100644 --- a/src/core/lib/config/config_vars.cc +++ b/src/core/lib/config/config_vars.cc @@ -20,11 +20,8 @@ #include "src/core/lib/config/config_vars.h" -#include - #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, grpc_not_use_system_ssl_roots, {}, "Disable loading system root certificates."); ABSL_FLAG(absl::optional, grpc_ssl_cipher_suites, {}, "A colon separated list of cipher suites to use with OpenSSL"); +ABSL_FLAG(absl::optional, 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 diff --git a/src/core/lib/config/config_vars.h b/src/core/lib/config/config_vars.h index 0ca8ad9f530..c252b2809dc 100644 --- a/src/core/lib/config/config_vars.h +++ b/src/core/lib/config/config_vars.h @@ -38,6 +38,7 @@ class GPR_DLL ConfigVars { absl::optional enable_fork_support; absl::optional abort_on_leaks; absl::optional not_use_system_ssl_roots; + absl::optional absl_logging; absl::optional dns_resolver; absl::optional verbosity; absl::optional 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_; diff --git a/src/core/lib/config/config_vars.yaml b/src/core/lib/config/config_vars.yaml index 8ccd41c2d41..f3811327d6a 100644 --- a/src/core/lib/config/config_vars.yaml +++ b/src/core/lib/config/config_vars.yaml @@ -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. diff --git a/src/core/lib/gpr/android/log.cc b/src/core/lib/gpr/android/log.cc index 92d17115361..34c705b8764 100644 --- a/src/core/lib/gpr/android/log.cc +++ b/src/core/lib/gpr/android/log.cc @@ -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; diff --git a/src/core/lib/gpr/linux/log.cc b/src/core/lib/gpr/linux/log.cc index 7a597f3bb59..a24e28fa82c 100644 --- a/src/core/lib/gpr/linux/log.cc +++ b/src/core/lib/gpr/linux/log.cc @@ -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]; diff --git a/src/core/lib/gpr/log.cc b/src/core/lib/gpr/log.cc index 25c53f9a5c1..1755d99122d 100644 --- a/src/core/lib/gpr/log.cc +++ b/src/core/lib/gpr/log.cc @@ -18,6 +18,8 @@ #include +#include "absl/log/log.h" + #include #include @@ -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_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(severity) >= gpr_atm_no_barrier_load(&g_min_severity_to_print_stacktrace) diff --git a/src/core/lib/gpr/posix/log.cc b/src/core/lib/gpr/posix/log.cc index 18088486118..4e933b7c4be 100644 --- a/src/core/lib/gpr/posix/log.cc +++ b/src/core/lib/gpr/posix/log.cc @@ -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]; diff --git a/src/core/lib/gpr/windows/log.cc b/src/core/lib/gpr/windows/log.cc index fe249e31c15..4dc48698140 100644 --- a/src/core/lib/gpr/windows/log.cc +++ b/src/core/lib/gpr/windows/log.cc @@ -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]; diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f3f4a909fd5..76daef457eb 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -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', diff --git a/src/python/grpcio_observability/observability_lib_deps.py b/src/python/grpcio_observability/observability_lib_deps.py index eb117797788..fe161656970 100644 --- a/src/python/grpcio_observability/observability_lib_deps.py +++ b/src/python/grpcio_observability/observability_lib_deps.py @@ -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', diff --git a/test/core/util/fuzz_config_vars.cc b/test/core/util/fuzz_config_vars.cc index 7fa9a4e51c7..7ec3b2382f1 100644 --- a/test/core/util/fuzz_config_vars.cc +++ b/test/core/util/fuzz_config_vars.cc @@ -18,10 +18,6 @@ #include "test/core/util/fuzz_config_vars.h" -#include - -#include "absl/types/optional.h" - #include "test/core/util/fuzz_config_vars_helpers.h" namespace grpc_core {