Permalink
Browse files

SERVER-6461: Ensure that nullstream instance is constructed before ma…

…in().
  • Loading branch information...
amschwerin committed Jul 16, 2012
1 parent 0adc5d1 commit 3e54e4c81705617abc25b6b6f1b7f04103b6b7d0
Showing with 5 additions and 2 deletions.
  1. +3 −1 src/mongo/util/log.cpp
  2. +2 −1 src/mongo/util/log.h
View
@@ -62,6 +62,9 @@ namespace mongo {
return Logstream::get().prolog();
}
+ Nullstream::Nullstream() {}
+ Nullstream::~Nullstream() {}
+
class LoggingManager {
public:
LoggingManager()
@@ -399,7 +402,6 @@ namespace mongo {
}
Logstream& Logstream::get() {
- fassert( 16397, doneSetup );
if ( StaticObserver::_destroyingStatics ) {
cout << "Logstream::get called in uninitialized state" << endl;
}
View
@@ -134,10 +134,11 @@ namespace mongo {
class Nullstream {
public:
+ Nullstream();
+ virtual ~Nullstream();
virtual Nullstream& operator<< (Tee* tee) {
return *this;
}
- virtual ~Nullstream() {}
virtual Nullstream& operator<<(const char *) {
return *this;
}

0 comments on commit 3e54e4c

Please sign in to comment.