summaryrefslogtreecommitdiff
path: root/src/mongo/util/assert_util.cpp
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@mongodb.com>2016-07-11 11:11:08 -0400
committerAndreas Nilsson <andreas.nilsson@mongodb.com>2016-07-11 13:16:34 -0400
commit1d0955a9289f3bbbfce1c5953ef83016a0e55855 (patch)
treeff378d36d32d8adef37837dd5319fe3a2b1daf48 /src/mongo/util/assert_util.cpp
parentc73a719b1c43e0b6b9c26e4e686ad5b1f940c67b (diff)
downloadmongo-1d0955a9289f3bbbfce1c5953ef83016a0e55855.tar.gz
SERVER-24524 Use log redaction functions to redact assertions
Diffstat (limited to 'src/mongo/util/assert_util.cpp')
-rw-r--r--src/mongo/util/assert_util.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp
index c6ef9c7273c..428146bc8cc 100644
--- a/src/mongo/util/assert_util.cpp
+++ b/src/mongo/util/assert_util.cpp
@@ -158,8 +158,8 @@ NOINLINE_DECL void invariantOKFailed(const char* expr,
const Status& status,
const char* file,
unsigned line) noexcept {
- log() << "Invariant failure: " << expr << " resulted in status " << status << " at " << file
- << ' ' << dec << line;
+ log() << "Invariant failure: " << expr << " resulted in status " << redact(status) << " at "
+ << file << ' ' << dec << line;
breakpoint();
log() << "\n\n***aborting after invariant() failure\n\n" << endl;
std::abort();
@@ -185,7 +185,8 @@ MONGO_COMPILER_NORETURN void fassertFailedWithStatusWithLocation(int msgid,
const Status& status,
const char* file,
unsigned line) noexcept {
- log() << "Fatal assertion " << msgid << " " << status << " at " << file << " " << dec << line;
+ log() << "Fatal assertion " << msgid << " " << redact(status) << " at " << file << " " << dec
+ << line;
breakpoint();
log() << "\n\n***aborting after fassert() failure\n\n" << endl;
std::abort();
@@ -195,7 +196,8 @@ MONGO_COMPILER_NORETURN void fassertFailedWithStatusNoTraceWithLocation(int msgi
const Status& status,
const char* file,
unsigned line) noexcept {
- log() << "Fatal assertion " << msgid << " " << status << " at " << file << " " << dec << line;
+ log() << "Fatal assertion " << msgid << " " << redact(status) << " at " << file << " " << dec
+ << line;
breakpoint();
log() << "\n\n***aborting after fassert() failure\n\n" << endl;
quickExit(EXIT_ABRUPT);
@@ -217,7 +219,8 @@ NOINLINE_DECL void uassertedWithLocation(int msgid,
const char* file,
unsigned line) {
assertionCount.condrollover(++assertionCount.user);
- log() << "User Assertion: " << msgid << ":" << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "User Assertion: " << msgid << ":" << redact(msg) << ' ' << file << ' ' << dec << line
+ << endl;
throw UserException(msgid, msg);
}
@@ -230,7 +233,8 @@ NOINLINE_DECL void msgassertedWithLocation(int msgid,
const char* file,
unsigned line) {
assertionCount.condrollover(++assertionCount.warning);
- log() << "Assertion: " << msgid << ":" << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "Assertion: " << msgid << ":" << redact(msg) << ' ' << file << ' ' << dec << line
+ << endl;
logContext();
throw MsgAssertionException(msgid, msg);
}
@@ -240,7 +244,8 @@ NOINLINE_DECL void msgassertedNoTraceWithLocation(int msgid,
const char* file,
unsigned line) {
assertionCount.condrollover(++assertionCount.warning);
- log() << "Assertion: " << msgid << ":" << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "Assertion: " << msgid << ":" << redact(msg) << ' ' << file << ' ' << dec << line
+ << endl;
throw MsgAssertionException(msgid, msg);
}