summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-05-16 16:42:37 -0400
committerDwight <dmerriman@gmail.com>2008-05-16 16:42:37 -0400
commit36435d4e78fc839dafceb46a342b8c1c6b3abe22 (patch)
tree393ab8647d8448b4fb3a6819f648d59ac564dbcc
parent86f689d3ac4124f74872eff9e1143bd826987327 (diff)
downloadmongo-36435d4e78fc839dafceb46a342b8c1c6b3abe22.tar.gz
debugging
-rw-r--r--db/db.cpp11
-rw-r--r--stdafx.h6
2 files changed, 13 insertions, 4 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 9b92559ca32..f8655b08353 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -130,9 +130,12 @@ void receivedUpdate(Message& m, stringstream& ss) {
ss << ns << ' ';
int flags = d.pullInt();
JSObj query = d.nextJsObj();
+cout << query.toString() << endl;
assert( d.moreJSObjs() );
assert( query.objsize() < m.data->dataLen() );
JSObj toupdate = d.nextJsObj();
+cout << toupdate.toString() << endl;
+cout << "TEMP " << flags << endl;
assert( toupdate.objsize() < m.data->dataLen() );
assert( query.objsize() + toupdate.objsize() < m.data->dataLen() );
updateObjects(ns, toupdate, query, flags & 1, ss);
@@ -455,7 +458,7 @@ void connThread()
receivedInsert(m, ss);
}
catch( AssertionException ) {
- problem() << "Caught Assertion insert, continuing" << endl;
+ problem() << " Caught Assertion insert, continuing" << endl;
cout << "Caught Assertion, continuing" << endl;
ss << " exception ";
}
@@ -466,7 +469,7 @@ void connThread()
receivedUpdate(m, ss);
}
catch( AssertionException ) {
- problem() << "Caught Assertion update, continuing" << endl;
+ problem() << " Caught Assertion update, continuing" << endl;
cout << "Caught Assertion update, continuing" << endl;
ss << " exception ";
}
@@ -477,7 +480,7 @@ void connThread()
receivedDelete(m);
}
catch( AssertionException ) {
- problem() << "Caught Assertion receviedDelete, continuing" << endl;
+ problem() << " Caught Assertion receviedDelete, continuing" << endl;
cout << "Caught Assertion receviedDelete, continuing" << endl;
ss << " exception ";
}
@@ -495,7 +498,7 @@ void connThread()
}
catch( AssertionException ) {
cout << "Caught Assertion in kill cursors, continuing" << endl;
- problem() << "Caught Assertion in kill cursors, continuing" << endl;
+ problem() << " Caught Assertion in kill cursors, continuing" << endl;
ss << " exception ";
}
}
diff --git a/stdafx.h b/stdafx.h
index e9b68dbf200..b63114fd161 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -89,11 +89,17 @@ typedef struct _OWS {
extern ofstream problems;
+class Client;
+extern Client *client;
+extern const char *curNs;
+
// not threadsafe
inline ofstream& problem() {
time_t t;
time(&t);
string now(ctime(&t),0,20);
problems << now;
+ if( client )
+ problems << curNs << ' ';
return problems;
}