summaryrefslogtreecommitdiff
path: root/db/client.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-02-04 22:51:57 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-04 22:51:57 -0500
commit52427e60ebef9e70fa65f38c31f63bdf6784a9b9 (patch)
treee1e8c3c28c270036cd3773d3a62da21588ffb95a /db/client.cpp
parentde8efe0a2aa6df39f1b3d3f0df9101a0be4f12bb (diff)
downloadmongo-52427e60ebef9e70fa65f38c31f63bdf6784a9b9.tar.gz
debugging MINOR
Diffstat (limited to 'db/client.cpp')
-rw-r--r--db/client.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/client.cpp b/db/client.cpp
index c62e5490d0e..8ac5006348f 100644
--- a/db/client.cpp
+++ b/db/client.cpp
@@ -141,4 +141,18 @@ namespace mongo {
_client->_context = _oldContext; // note: _oldContext may be null
}
+ string Client::toString() const {
+ stringstream ss;
+ if ( _curOp )
+ ss << _curOp->infoNoauth().jsonString();
+ return ss.str();
+ }
+
+ string sayClientState(){
+ Client* c = currentClient.get();
+ if ( ! c )
+ return "no client";
+ return c->toString();
+ }
+
}