diff options
author | Dwight <dwight@10gen.com> | 2010-08-26 12:18:03 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-09-15 14:41:05 -0400 |
commit | 4c677b4759a289c22b6b945d8b1d9ad65d3face2 (patch) | |
tree | 149d3ee440b4b418b0a6831f3f68885cb27144b1 | |
parent | 5191e5f0f5d4b1905a4775657b9cdf6bc1daf58e (diff) | |
download | mongo-4c677b4759a289c22b6b945d8b1d9ad65d3face2.tar.gz |
clean up logging. now that we show the thread the indentation wasnt useful
-rw-r--r-- | db/instance.cpp | 14 | ||||
-rw-r--r-- | util/sock.h | 15 | ||||
-rw-r--r-- | util/util.cpp | 5 |
3 files changed, 14 insertions, 20 deletions
diff --git a/db/instance.cpp b/db/instance.cpp index c436ae44b31..eeaadac7511 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -720,25 +720,25 @@ namespace mongo { void shutdown() { - log() << "\t shutdown: going to close listening sockets..." << endl; + log() << "shutdown: going to close listening sockets..." << endl; ListeningSockets::get()->closeAll(); - log() << "\t shutdown: going to flush oplog..." << endl; + log() << "shutdown: going to flush oplog..." << endl; stringstream ss2; flushOpLog( ss2 ); rawOut( ss2.str() ); /* must do this before unmapping mem or you may get a seg fault */ - log() << "\t shutdown: going to close sockets..." << endl; + log() << "shutdown: going to close sockets..." << endl; boost::thread close_socket_thread(closeAllSockets); // wait until file preallocation finishes // we would only hang here if the file_allocator code generates a // synchronous signal, which we don't expect - log() << "\t shutdown: waiting for fs preallocator..." << endl; + log() << "shutdown: waiting for fs preallocator..." << endl; theFileAllocator().waitUntilFinished(); - log() << "\t shutdown: closing all files..." << endl; + log() << "shutdown: closing all files..." << endl; stringstream ss3; MemoryMappedFile::closeAllFiles( ss3 ); rawOut( ss3.str() ); @@ -748,9 +748,9 @@ namespace mongo { #if !defined(_WIN32) && !defined(__sunos__) if ( lockFile ){ - log() << "\t shutdown: removing fs lock..." << endl; + log() << "shutdown: removing fs lock..." << endl; if( ftruncate( lockFile , 0 ) ) - log() << "\t couldn't remove fs lock " << errnoWithDescription() << endl; + log() << "couldn't remove fs lock " << errnoWithDescription() << endl; flock( lockFile, LOCK_UN ); } #endif diff --git a/util/sock.h b/util/sock.h index 300c24d2422..4b4290d2324 100644 --- a/util/sock.h +++ b/util/sock.h @@ -253,9 +253,7 @@ namespace mongo { class ListeningSockets { public: - ListeningSockets() : _mutex("ListeningSockets"), _sockets( new set<int>() ){ - } - + ListeningSockets() : _mutex("ListeningSockets"), _sockets( new set<int>() ) { } void add( int sock ){ scoped_lock lk( _mutex ); _sockets->insert( sock ); @@ -264,7 +262,6 @@ namespace mongo { scoped_lock lk( _mutex ); _sockets->erase( sock ); } - void closeAll(){ set<int>* s; { @@ -272,17 +269,13 @@ namespace mongo { s = _sockets; _sockets = new set<int>(); } - - for ( set<int>::iterator i=s->begin(); i!=s->end(); i++ ){ + for ( set<int>::iterator i=s->begin(); i!=s->end(); i++ ) { int sock = *i; - log() << "\t going to close listening socket: " << sock << endl; + log() << "closing listening socket: " << sock << endl; closesocket( sock ); - } - + } } - static ListeningSockets* get(); - private: mongo::mutex _mutex; set<int>* _sockets; diff --git a/util/util.cpp b/util/util.cpp index c7bc20a4315..b4b10537777 100644 --- a/util/util.cpp +++ b/util/util.cpp @@ -165,8 +165,9 @@ namespace mongo { char buf[64]; time_t_to_String( time(0) , buf ); - buf[20] = ' '; - buf[21] = 0; + /* truncate / don't show the year: */ + buf[19] = ' '; + buf[20] = 0; Logstream::logLockless(buf); Logstream::logLockless(s); |