[rhmessaging-commits] rhmessaging commits: r2071 - store/trunk/cpp/lib.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue May 20 17:10:58 EDT 2008


Author: kpvdr
Date: 2008-05-20 17:10:58 -0400 (Tue, 20 May 2008)
New Revision: 2071

Modified:
   store/trunk/cpp/lib/BdbMessageStore.cpp
   store/trunk/cpp/lib/JournalImpl.cpp
Log:
BZ447581: ""Enqueue capacity threshhold exceeded" logged to terminal" Found several cerr prints lying around in corners where they had been forgotten, this message included among them. Cleaned house, all messages now go through log.

Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp	2008-05-20 19:13:03 UTC (rev 2070)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp	2008-05-20 21:10:58 UTC (rev 2071)
@@ -305,9 +305,9 @@
             (*i)->close(0);
         }
     } catch (const DbException& e) {
-        std::cerr << "Error closing databases: " <<  e.what() << std::endl;
+        QPID_LOG(error, "Error closing databases: " <<  e.what());
     } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
+        QPID_LOG(error, e.what());
     } catch (...) {}
 
     if (mgmtObject.get() != 0)

Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp	2008-05-20 19:13:03 UTC (rev 2070)
+++ store/trunk/cpp/lib/JournalImpl.cpp	2008-05-20 21:10:58 UTC (rev 2071)
@@ -97,7 +97,7 @@
 {
     if (_init_flag && !_stop_flag){
     	try { stop(true); }
-        catch (const jexception& e) { std::cerr << e << std::endl; }
+        catch (const jexception& e) { log(LOG_ERROR, e.what()); }
 	}
     (dynamic_cast<GetEventsFireEvent*>(getEventsFireEventsPtr.get()))->cancel();
     (dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get()))->cancel();
@@ -459,21 +459,21 @@
             {
                 std::ostringstream oss;
                 oss << "Enqueue capacity threshold exceeded on queue \"" << _jid << "\".";
-                std::cerr << oss.str() << std::endl << std::flush;
+                log(LOG_WARN, oss.str());
                 THROW_STORE_FULL_EXCEPTION(oss.str());
             }
         case rhm::journal::RHM_IORES_FULL:
             {
                 std::ostringstream oss;
                 oss << "Journal full on queue \"" << _jid << "\".";
-                std::cerr << oss.str() << std::endl << std::flush;
+                log(LOG_CRITICAL, oss.str());
                 THROW_STORE_FULL_EXCEPTION(oss.str());
             }
         default:
             {
                 std::ostringstream oss;
                 oss << "Unexpected I/O response (" << rhm::journal::iores_str(r) << ") on queue " << _jid << "\".";
-                std::cerr << oss.str() << std::endl << std::flush;
+                log(LOG_ERROR, oss.str());
                 THROW_STORE_FULL_EXCEPTION(oss.str());
             }
     }




More information about the rhmessaging-commits mailing list