diff options
author | Eric Milkie <milkie@10gen.com> | 2012-04-05 16:21:23 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2012-04-05 16:54:11 -0400 |
commit | 1d0aa0508067701394b597b982a9a804adb7f208 (patch) | |
tree | 8f464101c71171c0682b109a37097cd0553cd66d /src/mongo/util | |
parent | d0235e5499f7d484d767fe8cfb792440d5efbd96 (diff) | |
download | mongo-1d0aa0508067701394b597b982a9a804adb7f208.tar.gz |
pare down pch.h some more
Moved some things out of pch.h; removed outright some other things.
Diffstat (limited to 'src/mongo/util')
-rw-r--r-- | src/mongo/util/assert_util.cpp | 3 | ||||
-rw-r--r-- | src/mongo/util/debug_util.h | 2 | ||||
-rw-r--r-- | src/mongo/util/log.cpp | 18 | ||||
-rw-r--r-- | src/mongo/util/log.h | 1 | ||||
-rw-r--r-- | src/mongo/util/util.cpp | 18 | ||||
-rw-r--r-- | src/mongo/util/util.h | 12 | ||||
-rw-r--r-- | src/mongo/util/version.cpp | 1 |
7 files changed, 36 insertions, 19 deletions
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index 66c64db2bc5..21386a5d6c8 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -24,7 +24,8 @@ using namespace std; #include <sys/file.h> #endif -#include "../bson/bsonobjbuilder.h" +#include "mongo/bson/bsonobjbuilder.h" +#include "mongo/util/util.h" namespace mongo { diff --git a/src/mongo/util/debug_util.h b/src/mongo/util/debug_util.h index cb9f95fbdfb..f1832565f50 100644 --- a/src/mongo/util/debug_util.h +++ b/src/mongo/util/debug_util.h @@ -38,8 +38,10 @@ namespace mongo { #if defined(_DEBUG) enum {DEBUG_BUILD = 1}; + const bool debug=true; #else enum {DEBUG_BUILD = 0}; + const bool debug=false; #endif #define MONGO_DEV if( DEBUG_BUILD ) diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp index de3528a7a72..cc393509b5c 100644 --- a/src/mongo/util/log.cpp +++ b/src/mongo/util/log.cpp @@ -386,4 +386,22 @@ namespace mongo { return *p; } + /* note: can't use malloc herein - may be in signal handler. + logLockless() likely does not comply and should still be fixed todo + likewise class string? + */ + void rawOut( const string &s ) { + if( s.empty() ) return; + + char buf[64]; + time_t_to_String( time(0) , buf ); + /* truncate / don't show the year: */ + buf[19] = ' '; + buf[20] = 0; + + Logstream::logLockless(buf); + Logstream::logLockless(s); + Logstream::logLockless("\n"); + } + } diff --git a/src/mongo/util/log.h b/src/mongo/util/log.h index a329faabe78..608a3894100 100644 --- a/src/mongo/util/log.h +++ b/src/mongo/util/log.h @@ -445,5 +445,6 @@ namespace mongo { extern Tee* const warnings; // Things put here go in serverStatus string errnoWithDescription(int errorcode = -1); + void rawOut( const string &s ); } // namespace mongo diff --git a/src/mongo/util/util.cpp b/src/mongo/util/util.cpp index 70ccefaecec..56f911bf5b2 100644 --- a/src/mongo/util/util.cpp +++ b/src/mongo/util/util.cpp @@ -193,24 +193,6 @@ namespace mongo { printStackTrace(); } - /* note: can't use malloc herein - may be in signal handler. - logLockless() likely does not comply and should still be fixed todo - likewise class string? - */ - void rawOut( const string &s ) { - if( s.empty() ) return; - - char buf[64]; - time_t_to_String( time(0) , buf ); - /* truncate / don't show the year: */ - buf[19] = ' '; - buf[20] = 0; - - Logstream::logLockless(buf); - Logstream::logLockless(s); - Logstream::logLockless("\n"); - } - ostream& operator<<( ostream &s, const ThreadSafeString &o ) { s << o.toString(); return s; diff --git a/src/mongo/util/util.h b/src/mongo/util/util.h new file mode 100644 index 00000000000..a0aa79d56db --- /dev/null +++ b/src/mongo/util/util.h @@ -0,0 +1,12 @@ +// Do not add anything new to this file. +// Find a better/more appropriate place instead. + +#pragma once + +#include <cstddef> + +namespace mongo { + + void sayDbContext(const char *msg = NULL); + +} // namespace mongo diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp index f36570b7916..18cfdce91d9 100644 --- a/src/mongo/util/version.cpp +++ b/src/mongo/util/version.cpp @@ -30,6 +30,7 @@ #include "ramlog.h" #include "../db/cmdline.h" #include "processinfo.h" +#include "mongo/db/pdfile.h" #include <boost/filesystem/operations.hpp> |