Skip to content

Commit ff847ba

Browse files
Internal change
PiperOrigin-RevId: 542053833
1 parent 4d9bbac commit ff847ba

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/google/protobuf/text_format.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,20 +2872,20 @@ void TextFormat::Printer::PrintUnknownFields(
28722872
}
28732873
}
28742874

2875-
namespace {
2875+
namespace internal {
28762876

28772877
// Check if the field is sensitive and should be redacted.
28782878
bool ShouldRedactField(const FieldDescriptor* field) {
28792879
if (field->options().debug_redact()) return true;
28802880
return false;
28812881
}
28822882

2883-
} // namespace
2883+
} // namespace internal
28842884

28852885
bool TextFormat::Printer::TryRedactFieldValue(
28862886
const Message& message, const FieldDescriptor* field,
28872887
BaseTextGenerator* generator, bool insert_value_separator) const {
2888-
if (ShouldRedactField(field)) {
2888+
if (internal::ShouldRedactField(field)) {
28892889
if (redact_debug_string_) {
28902890
IncrementRedactedFieldCounter();
28912891
if (insert_value_separator) {

src/google/protobuf/text_format.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_format_marker;
7171
PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_detection;
7272
PROTOBUF_EXPORT extern std::atomic<bool> enable_debug_text_redaction;
7373
PROTOBUF_EXPORT int64_t GetRedactedFieldCount();
74+
PROTOBUF_EXPORT bool ShouldRedactField(const FieldDescriptor* field);
7475

7576
// This enum contains all the APIs that convert protos to human-readable
7677
// formats. A higher-level API must correspond to a greater number than any

0 commit comments

Comments
 (0)