summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-06-05 10:35:04 -0400
committerEliot Horowitz <eliot@10gen.com>2009-06-05 10:35:04 -0400
commit5514c49e39849671826d863ed23d49ef58968a8f (patch)
tree37450bb91cc11d6a99274be96067dadbd5340b8f /util
parente5126fee80f8e5e801b613f7e95386e03893aec0 (diff)
downloadmongo-5514c49e39849671826d863ed23d49ef58968a8f.tar.gz
make lognoquiet and make --quit not print connect/disconnect
Diffstat (limited to 'util')
-rw-r--r--util/log.h9
-rw-r--r--util/message.cpp2
2 files changed, 10 insertions, 1 deletions
diff --git a/util/log.h b/util/log.h
index 5f8d7589f87..58d43117eeb 100644
--- a/util/log.h
+++ b/util/log.h
@@ -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
diff --git a/util/message.cpp b/util/message.cpp
index 533617cd6ff..f560508dae3 100644
--- a/util/message.cpp
+++ b/util/message.cpp
@@ -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) );
}
}