File tree Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,6 @@ namespace mongo {
3434
3535 MONGO_EXPORT_SERVER_PARAMETER (verboseQueryLogging, bool , false );
3636
37- class nullstream : public std ::ostream {
38- public:
39- nullstream () : std::ios(0 ), std::ostream(0 ) { }
40- };
41-
42- static nullstream theNullStream;
43-
4437 bool qlogOff () {
4538 bool old = verboseQueryLogging;
4639 verboseQueryLogging = false ;
@@ -53,14 +46,4 @@ namespace mongo {
5346 return old;
5447 }
5548
56- std::ostream& QLOG () {
57- if (verboseQueryLogging) {
58- return std::cout;
59- }
60- else {
61- return theNullStream;
62- }
63- }
64-
6549} // namespace mongo
66-
Original file line number Diff line number Diff line change 3232
3333namespace mongo {
3434
35- std::ostream& QLOG ();
35+ extern bool verboseQueryLogging;
36+
37+ // With a #define like this, we don't evaluate the costly toString()s that are QLOG'd
38+ #define QLOG () if (verboseQueryLogging) log()
3639
3740 bool qlogOff ();
3841 bool qlogOn ();
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ namespace mongo {
5555 INCLUDE_SHARD_FILTER = 4 ,
5656
5757 // Set this if you don't want any plans with a blocking sort stage. All sorts must be
58- // provided by the index.
58+ // provided by an index.
5959 NO_BLOCKING_SORT = 8 ,
6060 };
6161
You can’t perform that action at this time.
0 commit comments