Internal change

PiperOrigin-RevId: 542053833
pull/13080/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 4d9bbac167
commit ff847ba8f6
  1. 6
      src/google/protobuf/text_format.cc
  2. 1
      src/google/protobuf/text_format.h

@ -2872,7 +2872,7 @@ void TextFormat::Printer::PrintUnknownFields(
} }
} }
namespace { namespace internal {
// Check if the field is sensitive and should be redacted. // Check if the field is sensitive and should be redacted.
bool ShouldRedactField(const FieldDescriptor* field) { bool ShouldRedactField(const FieldDescriptor* field) {
@ -2880,12 +2880,12 @@ bool ShouldRedactField(const FieldDescriptor* field) {
return false; return false;
} }
} // namespace } // namespace internal
bool TextFormat::Printer::TryRedactFieldValue( bool TextFormat::Printer::TryRedactFieldValue(
const Message& message, const FieldDescriptor* field, const Message& message, const FieldDescriptor* field,
BaseTextGenerator* generator, bool insert_value_separator) const { BaseTextGenerator* generator, bool insert_value_separator) const {
if (ShouldRedactField(field)) { if (internal::ShouldRedactField(field)) {
if (redact_debug_string_) { if (redact_debug_string_) {
IncrementRedactedFieldCounter(); IncrementRedactedFieldCounter();
if (insert_value_separator) { if (insert_value_separator) {

@ -71,6 +71,7 @@ PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_format_marker;
PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_detection; PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_detection;
PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_redaction; PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_redaction;
PROTOBUF_EXPORT int64_t GetRedactedFieldCount(); PROTOBUF_EXPORT int64_t GetRedactedFieldCount();
PROTOBUF_EXPORT bool ShouldRedactField(const FieldDescriptor* field);
// This enum contains all the APIs that convert protos to human-readable // This enum contains all the APIs that convert protos to human-readable
// formats. A higher-level API must correspond to a greater number than any // formats. A higher-level API must correspond to a greater number than any

Loading…
Cancel
Save