diff options
Diffstat (limited to 'src/mongo/util/assert_util.cpp')
-rw-r--r-- | src/mongo/util/assert_util.cpp | 19 |
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); } |