summaryrefslogtreecommitdiff
path: root/util/log.h
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-05-19 12:11:17 -0400
committerDwight <dwight@10gen.com>2010-05-19 12:11:17 -0400
commitc830be1477b83d44df21c0909b9f64dfc5c945a6 (patch)
tree8b2a6dafee1daf256ad2132859543348b3254921 /util/log.h
parentec4b5cb36795dc1f97cdb0a2fe7ac40b1f96deb7 (diff)
downloadmongo-c830be1477b83d44df21c0909b9f64dfc5c945a6.tar.gz
log less during unit tests
Diffstat (limited to 'util/log.h')
-rw-r--r--util/log.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/log.h b/util/log.h
index da8508fd1a8..57e5371a785 100644
--- a/util/log.h
+++ b/util/log.h
@@ -224,6 +224,7 @@ namespace mongo {
};
extern int logLevel;
+ extern int tlogLevel;
inline Nullstream& out( int level = 0 ) {
if ( level > logLevel )
@@ -245,6 +246,14 @@ namespace mongo {
return Logstream::get();
}
+ /** logging which we may not want during unit tests runs.
+ set tlogLevel to -1 to suppress tlog() output in a test program. */
+ inline Nullstream& tlog( int level = 0 ) {
+ if ( level > tlogLevel || level > logLevel )
+ return nullstream;
+ return Logstream::get().prolog();
+ }
+
inline Nullstream& log( int level ) {
if ( level > logLevel )
return nullstream;