Internal change.

PiperOrigin-RevId: 627518025
pull/16620/head
Protobuf Team Bot 10 months ago committed by Copybara-Service
parent bd9f211f97
commit 0e223312ed
  1. 7
      src/google/protobuf/text_format.cc
  2. 2
      src/google/protobuf/text_format.h

@ -97,10 +97,6 @@ const char kDebugStringSilentMarkerForDetection[] = "\t ";
// Controls insertion of kDebugStringSilentMarker into DebugString() output. // Controls insertion of kDebugStringSilentMarker into DebugString() output.
PROTOBUF_EXPORT std::atomic<bool> enable_debug_text_format_marker; PROTOBUF_EXPORT std::atomic<bool> enable_debug_text_format_marker;
// Controls insertion of a marker making debug strings non-parseable, and
// redacting annotated fields.
PROTOBUF_EXPORT std::atomic<bool> enable_debug_text_redaction{true};
int64_t GetRedactedFieldCount() { int64_t GetRedactedFieldCount() {
return num_redacted_field.load(std::memory_order_relaxed); return num_redacted_field.load(std::memory_order_relaxed);
} }
@ -182,8 +178,7 @@ std::string StringifyMessage(const Message& message, Option option) {
break; break;
} }
printer.SetExpandAny(true); printer.SetExpandAny(true);
printer.SetRedactDebugString( printer.SetRedactDebugString(true);
internal::enable_debug_text_redaction.load(std::memory_order_relaxed));
printer.SetRandomizeDebugString(true); printer.SetRandomizeDebugString(true);
printer.SetReportSensitiveFields(reporter); printer.SetReportSensitiveFields(reporter);
std::string result; std::string result;

@ -45,8 +45,6 @@ PROTOBUF_EXPORT extern const char kDebugStringSilentMarker[1];
PROTOBUF_EXPORT extern const char kDebugStringSilentMarkerForDetection[3]; PROTOBUF_EXPORT extern const char kDebugStringSilentMarkerForDetection[3];
PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_format_marker; 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_redaction;
PROTOBUF_EXPORT int64_t GetRedactedFieldCount(); PROTOBUF_EXPORT int64_t GetRedactedFieldCount();
PROTOBUF_EXPORT bool ShouldRedactField(const FieldDescriptor* field); PROTOBUF_EXPORT bool ShouldRedactField(const FieldDescriptor* field);

Loading…
Cancel
Save