summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/catalog/index_catalog.cpp6
-rw-r--r--src/mongo/db/index/btree_based_access_method.cpp4
-rw-r--r--src/mongo/db/instance.cpp2
-rw-r--r--src/mongo/db/ops/delete_executor.cpp4
-rw-r--r--src/mongo/db/repl/master_slave.cpp22
-rw-r--r--src/mongo/db/structure/btree/btree_logic.cpp4
-rw-r--r--src/mongo/db/structure/record_store_v1_simple.cpp2
-rw-r--r--src/mongo/util/assert_util.cpp12
-rw-r--r--src/mongo/util/assert_util.h8
-rw-r--r--src/mongo/util/log.cpp4
-rw-r--r--src/mongo/util/log.h4
-rw-r--r--src/mongo/util/mmap.cpp4
-rw-r--r--src/mongo/util/mmap_posix.cpp6
-rw-r--r--src/mongo/util/net/sock.cpp2
14 files changed, 40 insertions, 44 deletions
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp
index 9cbf7e201b5..fac5d42bab9 100644
--- a/src/mongo/db/catalog/index_catalog.cpp
+++ b/src/mongo/db/catalog/index_catalog.cpp
@@ -1022,9 +1022,9 @@ namespace mongo {
Status status = index->accessMethod()->remove(txn, obj, loc, options, &removed);
if ( !status.isOK() ) {
- problem() << "Couldn't unindex record " << obj.toString()
- << " from collection " << _collection->ns()
- << ". Status: " << status.toString();
+ log() << "Couldn't unindex record " << obj.toString()
+ << " from collection " << _collection->ns()
+ << ". Status: " << status.toString();
}
return Status::OK();
diff --git a/src/mongo/db/index/btree_based_access_method.cpp b/src/mongo/db/index/btree_based_access_method.cpp
index 50287a9aadb..4b913ee1d7d 100644
--- a/src/mongo/db/index/btree_based_access_method.cpp
+++ b/src/mongo/db/index/btree_based_access_method.cpp
@@ -146,8 +146,8 @@ namespace mongo {
try {
ret = _newInterface->unindex(txn, key, loc);
} catch (AssertionException& e) {
- problem() << "Assertion failure: _unindex failed "
- << _descriptor->indexNamespace() << endl;
+ log() << "Assertion failure: _unindex failed "
+ << _descriptor->indexNamespace() << endl;
out() << "Assertion failure: _unindex failed: " << e.what() << '\n';
out() << " key:" << key.toString() << '\n';
out() << " dl:" << loc.toString() << endl;
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 457ebc471dd..9c104746f72 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -1347,7 +1347,7 @@ namespace {
string name = ss.str();
f = new ofstream(name.c_str(), ios::out | ios::binary);
if ( ! f->good() ) {
- problem() << "diagLogging couldn't open " << name << endl;
+ log() << "diagLogging couldn't open " << name << endl;
// todo what is this? :
throw 1717;
}
diff --git a/src/mongo/db/ops/delete_executor.cpp b/src/mongo/db/ops/delete_executor.cpp
index 69359defd60..facf815d3b8 100644
--- a/src/mongo/db/ops/delete_executor.cpp
+++ b/src/mongo/db/ops/delete_executor.cpp
@@ -153,8 +153,8 @@ namespace mongo {
if (logop) {
if ( toDelete.isEmpty() ) {
- problem() << "Deleted object without id in collection " << collection->ns()
- << ", not logging.";
+ log() << "Deleted object without id in collection " << collection->ns()
+ << ", not logging.";
}
else {
bool replJustOne = true;
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index 4cdbecc4ae7..820a042c498 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -414,7 +414,7 @@ namespace repl {
return;
}
else {
- problem() << "resync of " << db << " from " << hostName << " failed " << errmsg << endl;
+ log() << "resync of " << db << " from " << hostName << " failed " << errmsg << endl;
throw SyncException();
}
}
@@ -570,12 +570,12 @@ namespace repl {
nsToDatabase(ns, clientName);
if ( *ns == '.' ) {
- problem() << "skipping bad op in oplog: " << op.toString() << endl;
+ log() << "skipping bad op in oplog: " << op.toString() << endl;
return;
}
else if ( *ns == 0 ) {
/*if( op.getStringField("op")[0] != 'n' )*/ {
- problem() << "halting replication, bad op in oplog:\n " << op.toString() << endl;
+ log() << "halting replication, bad op in oplog:\n " << op.toString() << endl;
replAllDead = "bad object in oplog";
throw SyncException();
}
@@ -803,7 +803,7 @@ namespace repl {
}
if( !oplogReader.haveCursor() ) {
- problem() << "repl: dbclient::query returns null (conn closed?)" << endl;
+ log() << "repl: dbclient::query returns null (conn closed?)" << endl;
oplogReader.resetConnection();
return -1;
}
@@ -846,16 +846,16 @@ namespace repl {
if ( !err.empty() ) {
// 13051 is "tailable cursor requested on non capped collection"
if (op.getIntField("code") == 13051) {
- problem() << "trying to slave off of a non-master" << '\n';
+ log() << "trying to slave off of a non-master" << '\n';
massert( 13344 , "trying to slave off of a non-master", false );
}
else {
- problem() << "repl: $err reading remote oplog: " + err << '\n';
+ log() << "repl: $err reading remote oplog: " + err << '\n';
massert( 10390 , "got $err reading remote oplog", false );
}
}
else {
- problem() << "repl: bad object read from remote oplog: " << op.toString() << '\n';
+ log() << "repl: bad object read from remote oplog: " << op.toString() << '\n';
massert( 10391 , "repl: bad object read from remote oplog", false);
}
}
@@ -1223,16 +1223,16 @@ namespace repl {
}
catch ( AssertionException& ) {
ReplInfo r("Assertion in replSlaveThread(): sleeping 5 minutes before retry");
- problem() << "Assertion in replSlaveThread(): sleeping 5 minutes before retry" << endl;
+ log() << "Assertion in replSlaveThread(): sleeping 5 minutes before retry" << endl;
sleepsecs(300);
}
catch ( DBException& e ) {
- problem() << "exception in replSlaveThread(): " << e.what()
- << ", sleeping 5 minutes before retry" << endl;
+ log() << "exception in replSlaveThread(): " << e.what()
+ << ", sleeping 5 minutes before retry" << endl;
sleepsecs(300);
}
catch ( ... ) {
- problem() << "error in replSlaveThread(): sleeping 5 minutes before retry" << endl;
+ log() << "error in replSlaveThread(): sleeping 5 minutes before retry" << endl;
sleepsecs(300);
}
}
diff --git a/src/mongo/db/structure/btree/btree_logic.cpp b/src/mongo/db/structure/btree/btree_logic.cpp
index e8a2245cba6..5d54544fc05 100644
--- a/src/mongo/db/structure/btree/btree_logic.cpp
+++ b/src/mongo/db/structure/btree/btree_logic.cpp
@@ -69,7 +69,7 @@ namespace mongo {
string msg = str::stream() << "Btree::insert: key too large to index, failing "
<< _logic->_indexName
<< ' ' << key->dataSize() << ' ' << key->toString();
- problem() << msg << endl;
+ log() << msg << endl;
return Status(ErrorCodes::KeyTooLong, msg);
}
@@ -2163,7 +2163,7 @@ namespace mongo {
int z = k1.data.woCompare(k2.data, ordering);
//wassert( z <= 0 );
if (z > 0) {
- problem() << "Btree keys out of order in collection " << ns;
+ log() << "Btree keys out of order in collection " << ns;
ONCE {
dumpBucket(bucket);
}
diff --git a/src/mongo/db/structure/record_store_v1_simple.cpp b/src/mongo/db/structure/record_store_v1_simple.cpp
index da502bf0c66..d9747d4ed55 100644
--- a/src/mongo/db/structure/record_store_v1_simple.cpp
+++ b/src/mongo/db/structure/record_store_v1_simple.cpp
@@ -104,7 +104,7 @@ namespace mongo {
<< ", link number " << chain
<< ", invalid link is " << cur.toString()
<< ", throwing Fatal Assertion";
- problem() << sb.str() << endl;
+ log() << sb.str() << endl;
fassertFailed(16469);
}
}
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp
index a2d52a6cbc2..fd313d9c781 100644
--- a/src/mongo/util/assert_util.cpp
+++ b/src/mongo/util/assert_util.cpp
@@ -109,7 +109,7 @@ namespace mongo {
lastWhen = time(0);
lastLine = line;
- problem() << "warning assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "warning assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
logContext();
setLastError(0,msg && *msg ? msg : "wassertion failure");
assertionCount.condrollover( ++assertionCount.warning );
@@ -122,7 +122,7 @@ namespace mongo {
NOINLINE_DECL void verifyFailed(const char *msg, const char *file, unsigned line) {
assertionCount.condrollover( ++assertionCount.regular );
- problem() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
logContext();
setLastError(0,msg && *msg ? msg : "assertion failure");
stringstream temp;
@@ -138,7 +138,7 @@ namespace mongo {
}
NOINLINE_DECL void invariantFailed(const char *msg, const char *file, unsigned line) {
- problem() << "Invariant failure " << msg << ' ' << file << ' ' << dec << line << endl;
+ log() << "Invariant failure " << msg << ' ' << file << ' ' << dec << line << endl;
logContext();
breakpoint();
log() << "\n\n***aborting after invariant() failure\n\n" << endl;
@@ -146,7 +146,7 @@ namespace mongo {
}
NOINLINE_DECL void fassertFailed( int msgid ) {
- problem() << "Fatal Assertion " << msgid << endl;
+ log() << "Fatal Assertion " << msgid << endl;
logContext();
breakpoint();
log() << "\n\n***aborting after fassert() failure\n\n" << endl;
@@ -154,14 +154,14 @@ namespace mongo {
}
NOINLINE_DECL void fassertFailedNoTrace( int msgid ) {
- problem() << "Fatal Assertion " << msgid << endl;
+ log() << "Fatal Assertion " << msgid << endl;
breakpoint();
log() << "\n\n***aborting after fassert() failure\n\n" << endl;
::_exit(EXIT_ABRUPT); // bypass our handler for SIGABRT, which prints a stack trace.
}
MONGO_COMPILER_NORETURN void fassertFailedWithStatus(int msgid, const Status& status) {
- problem() << "Fatal assertion " << msgid << " " << status;
+ log() << "Fatal assertion " << msgid << " " << status;
logContext();
breakpoint();
log() << "\n\n***aborting after fassert() failure\n\n" << endl;
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h
index dad19c08d42..525631e2e48 100644
--- a/src/mongo/util/assert_util.h
+++ b/src/mongo/util/assert_util.h
@@ -311,10 +311,10 @@ namespace mongo {
try { \
expression; \
} catch ( const std::exception &e ) { \
- problem() << "caught exception (" << e.what() << ") in destructor (" << __FUNCTION__ \
- << ")" << std::endl; \
+ ::mongo::log() << "caught exception (" << e.what() << ") in destructor (" << __FUNCTION__ \
+ << ")" << std::endl; \
} catch ( ... ) { \
- problem() << "caught unknown exception in destructor (" << __FUNCTION__ << ")" \
- << std::endl; \
+ ::mongo::log() << "caught unknown exception in destructor (" << __FUNCTION__ << ")" \
+ << std::endl; \
}
diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp
index 0a5c04efb6c..ebf7556f109 100644
--- a/src/mongo/util/log.cpp
+++ b/src/mongo/util/log.cpp
@@ -129,9 +129,9 @@ namespace mongo {
void logContext(const char *errmsg) {
if ( errmsg ) {
- problem() << errmsg << endl;
+ log() << errmsg << endl;
}
- printStackTrace(problem().stream());
+ printStackTrace(log().stream());
}
LogIndentLevel::LogIndentLevel() {
diff --git a/src/mongo/util/log.h b/src/mongo/util/log.h
index 6b4c1ede450..6f341cabb49 100644
--- a/src/mongo/util/log.h
+++ b/src/mongo/util/log.h
@@ -96,10 +96,6 @@ namespace logger {
#define LOG MONGO_LOG
- inline LogstreamBuilder problem() {
- return log();
- }
-
/**
* Rotates the log files. Returns true if all logs rotate successfully.
*/
diff --git a/src/mongo/util/mmap.cpp b/src/mongo/util/mmap.cpp
index 565fb860831..61e338bc4d0 100644
--- a/src/mongo/util/mmap.cpp
+++ b/src/mongo/util/mmap.cpp
@@ -240,8 +240,8 @@ namespace {
}
void dataSyncFailedHandler() {
- problem() << "error syncing data to disk, probably a disk error";
- problem() << " shutting down immediately to avoid corruption";
+ log() << "error syncing data to disk, probably a disk error";
+ log() << " shutting down immediately to avoid corruption";
fassertFailed( 17346 );
}
diff --git a/src/mongo/util/mmap_posix.cpp b/src/mongo/util/mmap_posix.cpp
index f20ca28eaab..22367dbe2e0 100644
--- a/src/mongo/util/mmap_posix.cpp
+++ b/src/mongo/util/mmap_posix.cpp
@@ -254,8 +254,8 @@ namespace mongo {
return;
if ( msync(viewForFlushing(), len, sync ? MS_SYNC : MS_ASYNC) ) {
// msync failed, this is very bad
- problem() << "msync failed: " << errnoWithDescription()
- << " file: " << filename() << endl;
+ log() << "msync failed: " << errnoWithDescription()
+ << " file: " << filename() << endl;
dataSyncFailedHandler();
}
}
@@ -290,7 +290,7 @@ namespace mongo {
}
// we got an error, and we still exist, so this is bad, we fail
- problem() << "msync " << errnoWithDescription() << endl;
+ log() << "msync " << errnoWithDescription() << endl;
dataSyncFailedHandler();
}
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
index e499847260f..a1b9d8dd9bd 100644
--- a/src/mongo/util/net/sock.cpp
+++ b/src/mongo/util/net/sock.cpp
@@ -940,7 +940,7 @@ namespace mongo {
WSADATA d;
if ( WSAStartup(MAKEWORD(2,2), &d) != 0 ) {
out() << "ERROR: wsastartup failed " << errnoWithDescription() << endl;
- problem() << "ERROR: wsastartup failed " << errnoWithDescription() << endl;
+ log() << "ERROR: wsastartup failed " << errnoWithDescription() << endl;
_exit(EXIT_NTSERVICE_ERROR);
}
}