diff options
author | Andreas Nilsson <andreas.nilsson@mongodb.com> | 2016-07-08 16:02:45 -0400 |
---|---|---|
committer | Andreas Nilsson <andreas.nilsson@mongodb.com> | 2016-07-08 16:03:13 -0400 |
commit | 40002946c16bf293491fdb643e688a39d0c62781 (patch) | |
tree | 02d66cfed6e6118045500f262d312ef082da708c /src/mongo/bson/bsonobj.cpp | |
parent | b5d6a7c61c1ecdaf9d577ca75942d82363e0552c (diff) | |
download | mongo-40002946c16bf293491fdb643e688a39d0c62781.tar.gz |
SERVER-24521 Log redaction 'redact' functions
Diffstat (limited to 'src/mongo/bson/bsonobj.cpp')
-rw-r--r-- | src/mongo/bson/bsonobj.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/bson/bsonobj.cpp b/src/mongo/bson/bsonobj.cpp index b57f6bcf88b..992e2dd0a89 100644 --- a/src/mongo/bson/bsonobj.cpp +++ b/src/mongo/bson/bsonobj.cpp @@ -603,14 +603,15 @@ int BSONObj::nFields() const { return n; } -std::string BSONObj::toString() const { +std::string BSONObj::toString(bool redactValues) const { if (isEmpty()) return "{}"; StringBuilder s; - toString(s, false, false); + toString(s, false, false, redactValues); return s.str(); } -void BSONObj::toString(StringBuilder& s, bool isArray, bool full, int depth) const { +void BSONObj::toString( + StringBuilder& s, bool isArray, bool full, bool redactValues, int depth) const { if (isEmpty()) { s << (isArray ? "[]" : "{}"); return; @@ -635,7 +636,7 @@ void BSONObj::toString(StringBuilder& s, bool isArray, bool full, int depth) con first = false; else s << ", "; - e.toString(s, !isArray, full, depth); + e.toString(s, !isArray, full, redactValues, depth); } s << (isArray ? " ]" : " }"); } |