diff options
| author | Antonin Kral <a.kral@bobek.cz> | 2010-09-24 19:01:03 +0200 |
|---|---|---|
| committer | Antonin Kral <a.kral@bobek.cz> | 2010-09-24 19:01:03 +0200 |
| commit | 0ad0c09511a04ebe837f2acb859d47f2aa4e038a (patch) | |
| tree | 109babcb556f6c5884b77853120717f0617c7a1e /util/util.cpp | |
| parent | 03e58f81cad8dd4cfcd1530f327116f0cff6ceb3 (diff) | |
Imported Upstream version 1.6.3
Diffstat (limited to 'util/util.cpp')
| -rw-r--r-- | util/util.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/util/util.cpp b/util/util.cpp index 02abfa902ea..b4b10537777 100644 --- a/util/util.cpp +++ b/util/util.cpp @@ -156,20 +156,22 @@ 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 + */ void rawOut( const string &s ) { if( s.empty() ) return; - boost::scoped_array<char> buf_holder(new char[32 + s.size()]); - char * buf = buf_holder.get(); - + char buf[64]; time_t_to_String( time(0) , buf ); - buf[20] = ' '; - strncpy( buf + 21 , s.c_str() , s.size() ); - buf[21+s.size()] = '\n'; - buf[21+s.size()+1] = 0; + /* truncate / don't show the year: */ + buf[19] = ' '; + buf[20] = 0; - Logstream::logLockless( buf ); + Logstream::logLockless(buf); + Logstream::logLockless(s); + Logstream::logLockless("\n"); } ostream& operator<<( ostream &s, const ThreadSafeString &o ){ |
