From 81bc570b41f59f8a7101df13892272bae6da9857 Mon Sep 17 00:00:00 2001 From: Thomas Schubert Date: Wed, 24 Aug 2016 16:01:07 -0400 Subject: SERVER-24991 log redaction for bson, client, auth, catalog --- src/mongo/db/cloner.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mongo/db/cloner.cpp') diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index ec78619b22e..249b807ab53 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -163,7 +163,7 @@ struct Cloner::Fun { if (now - lastLog >= 60) { // report progress if (lastLog) - log() << "clone " << to_collection << ' ' << numSeen << endl; + log() << "clone " << to_collection << ' ' << numSeen; lastLog = now; } txn->checkForInterrupt(); @@ -224,7 +224,7 @@ struct Cloner::Fun { if (!status.isOK()) { str::stream ss; ss << "Cloner: found corrupt document in " << from_collection.toString() << ": " - << status.reason(); + << redact(status); if (skipCorruptDocumentsWhenCloning) { warning() << ss.ss.str() << "; skipping"; continue; @@ -244,7 +244,7 @@ struct Cloner::Fun { Status status = collection->insertDocument(txn, doc, nullOpDebug, true); if (!status.isOK()) { error() << "error: exception cloning object in " << from_collection << ' ' - << status << " obj:" << doc; + << redact(status) << " obj:" << redact(doc); } uassertStatusOK(status); wunit.commit(); @@ -280,7 +280,7 @@ void Cloner::copy(OperationContext* txn, const CloneOptions& opts, Query query) { LOG(2) << "\t\tcloning collection " << from_collection << " to " << to_collection << " on " - << _conn->getServerAddress() << " with filter " << query.toString() << endl; + << _conn->getServerAddress() << " with filter " << redact(query.toString()); Fun f(txn, toDBName); f.numSeen = 0; @@ -461,7 +461,7 @@ bool Cloner::copyCollection(OperationContext* txn, /* TODO : copyIndexes bool does not seem to be implemented! */ if (!shouldCopyIndexes) { - log() << "ERROR copy collection shouldCopyIndexes not implemented? " << ns << endl; + log() << "ERROR copy collection shouldCopyIndexes not implemented? " << ns; } // indexes @@ -494,7 +494,7 @@ StatusWith> Cloner::filterCollectionsForClone( if (ns.isSystem()) { if (legalClientSystemNS(ns.ns()) == 0) { - LOG(2) << "\t\t not cloning because system collection" << endl; + LOG(2) << "\t\t not cloning because system collection"; continue; } } @@ -631,7 +631,7 @@ Status Cloner::copyDb(OperationContext* txn, } } for (auto&& collection : toClone) { - LOG(2) << " really will clone: " << collection << endl; + LOG(2) << " really will clone: " << collection; const char* collectionName = collection["name"].valuestr(); BSONObj options = collection.getObjectField("options"); @@ -643,7 +643,7 @@ Status Cloner::copyDb(OperationContext* txn, clonedColls->insert(from_name.ns()); } - LOG(1) << "\t\t cloning " << from_name << " -> " << to_name << endl; + LOG(1) << "\t\t cloning " << from_name << " -> " << to_name; Query q; if (opts.snapshot) q.snapshot(); -- cgit v1.2.1