diff options
author | Eric Milkie <milkie@10gen.com> | 2016-07-08 08:52:51 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2016-07-08 08:52:51 -0400 |
commit | 7e4412ef2a99ba791b8e345accf851c26656aec7 (patch) | |
tree | 1cdea85fb1fc24322ab39216f92907c0a733cc44 /src/mongo/util/assert_util.cpp | |
parent | 2addaf9a63c60e2311e266c11ad1bcdb12210d0b (diff) | |
download | mongo-7e4412ef2a99ba791b8e345accf851c26656aec7.tar.gz |
Revert "SERVER-24523 Include file and line numbers in assertions"
This reverts commit 744750da3a7173def0c37025e6d21f2c358363b5.
Diffstat (limited to 'src/mongo/util/assert_util.cpp')
-rw-r--r-- | src/mongo/util/assert_util.cpp | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index 0148969aaff..99b4ec6f5a0 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -165,42 +165,39 @@ NOINLINE_DECL void invariantOKFailed(const char* expr, std::abort(); } -NOINLINE_DECL void fassertFailedWithLocation(int msgid, const char* file, unsigned line) noexcept { - log() << "Fatal Assertion " << msgid << " at " << file << " " << dec << line; +NOINLINE_DECL void fassertFailed(int msgid) noexcept { + log() << "Fatal Assertion " << msgid << endl; breakpoint(); log() << "\n\n***aborting after fassert() failure\n\n" << endl; std::abort(); } -NOINLINE_DECL void fassertFailedNoTraceWithLocation(int msgid, - const char* file, - unsigned line) noexcept { - log() << "Fatal Assertion " << msgid << " at " << file << " " << dec << line; +NOINLINE_DECL void fassertFailedNoTrace(int msgid) noexcept { + log() << "Fatal Assertion " << msgid << endl; breakpoint(); log() << "\n\n***aborting after fassert() failure\n\n" << endl; quickExit(EXIT_ABRUPT); } -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; +MONGO_COMPILER_NORETURN void fassertFailedWithStatus(int msgid, const Status& status) noexcept { + log() << "Fatal assertion " << msgid << " " << status; breakpoint(); log() << "\n\n***aborting after fassert() failure\n\n" << endl; std::abort(); } -MONGO_COMPILER_NORETURN void fassertFailedWithStatusNoTraceWithLocation(int msgid, - const Status& status, - const char* file, - unsigned line) noexcept { - log() << "Fatal assertion " << msgid << " " << status << " at " << file << " " << dec << line; +MONGO_COMPILER_NORETURN void fassertFailedWithStatusNoTrace(int msgid, + const Status& status) noexcept { + log() << "Fatal assertion " << msgid << " " << status; breakpoint(); log() << "\n\n***aborting after fassert() failure\n\n" << endl; quickExit(EXIT_ABRUPT); } +void uasserted(int msgid, const string& msg) { + uasserted(msgid, msg.c_str()); +} + void UserException::appendPrefix(stringstream& ss) const { ss << "userassert:"; } @@ -208,29 +205,19 @@ void MsgAssertionException::appendPrefix(stringstream& ss) const { ss << "massert:"; } -void uassertedWithLocation(int msgid, const string& msg, const char* file, unsigned line) { - uassertedWithLocation(msgid, msg.c_str(), file, line); -} - -NOINLINE_DECL void uassertedWithLocation(int msgid, - const char* msg, - const char* file, - unsigned line) { +NOINLINE_DECL void uasserted(int msgid, const char* msg) { assertionCount.condrollover(++assertionCount.user); - log() << "User Assertion: " << msgid << ":" << msg << ' ' << file << ' ' << dec << line << endl; + LOG(1) << "User Assertion: " << msgid << ":" << msg << endl; throw UserException(msgid, msg); } -void msgassertedWithLocation(int msgid, const string& msg, const char* file, unsigned line) { - msgassertedWithLocation(msgid, msg.c_str(), file, line); +void msgasserted(int msgid, const string& msg) { + msgasserted(msgid, msg.c_str()); } -NOINLINE_DECL void msgassertedWithLocation(int msgid, - const char* msg, - const char* file, - unsigned line) { +NOINLINE_DECL void msgasserted(int msgid, const char* msg) { assertionCount.condrollover(++assertionCount.warning); - log() << "Assertion: " << msgid << ":" << msg << ' ' << file << ' ' << dec << line << endl; + log() << "Assertion: " << msgid << ":" << msg << endl; logContext(); throw MsgAssertionException(msgid, msg); } |