summaryrefslogtreecommitdiff
path: root/stdafx.cpp
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-02-04 13:09:00 -0500
committerAaron <aaron@10gen.com>2009-02-04 13:09:00 -0500
commit83915a68783c30d7054ece53f8b67340da01278a (patch)
tree4365927d81e5beb58068a91792e44bf0cbc490da /stdafx.cpp
parent57dc491b4b6447e24e41d60f75516e4b443d2363 (diff)
downloadmongo-83915a68783c30d7054ece53f8b67340da01278a.tar.gz
Add timestamp to lockless output function
Diffstat (limited to 'stdafx.cpp')
-rw-r--r--stdafx.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/stdafx.cpp b/stdafx.cpp
index ade2d6281ef..b4f90f7162a 100644
--- a/stdafx.cpp
+++ b/stdafx.cpp
@@ -106,5 +106,19 @@ namespace mongo {
dbexit( status );
}
+ void rawOut( const string &s ) {
+ char now[64];
+ time_t_to_String(time(0), now);
+ now[20] = 0;
+#if defined(_WIN32)
+ (std::cout << now << " " << s).flush();
+#else
+ write( STDOUT_FILENO, now, 20 );
+ write( STDOUT_FILENO, " ", 1 );
+ write( STDOUT_FILENO, s.c_str(), s.length() );
+ fsync( STDOUT_FILENO );
+#endif
+ }
+
} // namespace mongo