summaryrefslogtreecommitdiff
path: root/src/mongo/util/log.cpp
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2012-10-31 14:56:00 -0400
committerRandolph Tan <randolph@10gen.com>2012-10-31 15:49:17 -0400
commitdfbc5b910ba93f7c17463f7b7402b42c8c99321e (patch)
treeac3033362c637b0803643801c2a755118562b49f /src/mongo/util/log.cpp
parent44e2a3167adb48e9055639bbd9d94bd9c4d4460b (diff)
downloadmongo-dfbc5b910ba93f7c17463f7b7402b42c8c99321e.tar.gz
SERVER-6295 make time in log have millisecond precision
Diffstat (limited to 'src/mongo/util/log.cpp')
-rw-r--r--src/mongo/util/log.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp
index 980bb6a5490..94761f5e15d 100644
--- a/src/mongo/util/log.cpp
+++ b/src/mongo/util/log.cpp
@@ -315,7 +315,9 @@ namespace mongo {
bufSize += 128;
BufBuilder b(bufSize);
- time_t_to_String( time(0) , b.grow(20) );
+ char* dateStr = b.grow(24);
+ curTimeString(dateStr);
+ dateStr[23] = ' '; // change null char to space
if (!threadName.empty()) {
b.appendChar( '[' );
@@ -417,10 +419,9 @@ namespace mongo {
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;
+ curTimeString(buf);
+ buf[23] = ' ';
+ buf[24] = 0;
Logstream::logLockless(buf);
Logstream::logLockless(s);