0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

make lognoquiet and make --quit not print connect/disconnect

This commit is contained in:
Eliot Horowitz 2009-06-05 10:35:04 -04:00
parent e5126fee80
commit 5514c49e39
5 changed files with 15 additions and 3 deletions

View File

@ -3,6 +3,9 @@
namespace mongo {
const char * curNs = "in client mode";
bool quiet = false;
// Database* database = 0;
void dbexit(int returnCode, const char *whyMsg ) {

View File

@ -198,7 +198,7 @@ namespace mongo {
m.reset();
if ( !dbMsgPort.recv(m) ) {
log() << "end connection " << dbMsgPort.farEnd.toString() << endl;
lognoquiet() << "end connection " << dbMsgPort.farEnd.toString() << endl;
dbMsgPort.shutdown();
break;
}

View File

@ -33,7 +33,7 @@ namespace mongo {
const char *curNs = "";
Database *database = 0;
string ourHostname;
bool quiet = false;
OID serverID;

View File

@ -20,6 +20,8 @@
namespace mongo {
extern bool quiet;
// Utility interface for stringifying object only when val() called.
class LazyString {
public:
@ -182,8 +184,15 @@ namespace mongo {
return logstream.prolog();
}
inline Nullstream& lognoquiet(){
if ( quiet )
return nullstream;
return log();
}
inline ostream& stdcout() {
return cout;
}
} // namespace mongo

View File

@ -83,7 +83,7 @@ namespace mongo {
continue;
}
disableNagle(s);
log() << "connection accepted from " << from.toString() << endl;
lognoquiet() << "connection accepted from " << from.toString() << endl;
accepted( new MessagingPort(s, from) );
}
}