From 155c8c183dc02be13e87018c2946f9581dd65adc Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 4 Nov 2022 14:00:05 -0700 Subject: [PATCH] Internal change. PiperOrigin-RevId: 486224511 --- src/google/protobuf/text_format.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index 2bf1789c9e..fbf1f717c2 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -2571,6 +2571,15 @@ void TextFormat::Printer::PrintFieldValue(const Message& message, << "Index must be -1 for non-repeated fields"; const FastFieldValuePrinter* printer = GetFieldPrinter(field); +#ifndef PROTO2_OPENSOURCE +#ifdef SUPPORT_EXPLICIT_DEBUG_STRING + if (redact_debug_string_ && internal::ShouldRedactField(field)) { + std::string redacted_value = "go/redact-debug-string"; + generator->PrintString(redacted_value); + return; + } +#endif +#endif switch (field->cpp_type()) { #define OUTPUT_FIELD(CPPTYPE, METHOD) \