0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

only return tail ov raw mongo program output if very long

This commit is contained in:
Aaron 2010-02-03 00:06:06 -08:00
parent c49737335d
commit 9eaaef4a6c

View File

@ -197,9 +197,14 @@ namespace mongo {
mongoProgramOutput_ << buf.str() << endl;
}
// only returns last 10000 characters
BSONObj RawMongoProgramOutput( const BSONObj &args ) {
boost::mutex::scoped_lock lk( mongoProgramOutputMutex );
return BSON( "" << mongoProgramOutput_.str() );
string out = mongoProgramOutput_.str();
size_t len = out.length();
if ( len > 10000 )
out = out.substr( len - 10000, 10000 );
return BSON( "" << out );
}
class MongoProgramRunner {