[asterisk-scf-commits] asterisk-scf/release/bridging.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Dec 21 09:50:17 CST 2011


branch "master" has been updated
       via  e5178070c8f1620af13bf68f4f3939de20ed9ab1 (commit)
      from  33c6a09cc7f2605fb3512e8bc0fb236d42e7e72c (commit)

Summary of changes:
 src/BridgeCreationExtensionPointImpl.cpp |   10 ++++----
 src/BridgeImpl.cpp                       |   32 +++++++++++++++---------------
 src/BridgeManagerImpl.cpp                |    5 +++-
 src/BridgeReplicatorStateListenerI.cpp   |   12 ++++++++--
 src/MediaSplicer.cpp                     |    4 +-
 src/SessionListener.cpp                  |    4 +-
 6 files changed, 38 insertions(+), 29 deletions(-)


- Log -----------------------------------------------------------------
commit e5178070c8f1620af13bf68f4f3939de20ed9ab1
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Dec 21 12:18:32 2011 -0330

    * Moved some logging to Trace level to clean up test output.
    
    * Fixed some catch() blocks in BridgeImpl.cpp that were catching
      std::exception by value which slices the exception and removes the actual
      exception info. Test output currently indicates that a null handle
      exception is being thrown.. which is a little disconcerting.

diff --git a/src/BridgeCreationExtensionPointImpl.cpp b/src/BridgeCreationExtensionPointImpl.cpp
index 6a4ab31..172321f 100755
--- a/src/BridgeCreationExtensionPointImpl.cpp
+++ b/src/BridgeCreationExtensionPointImpl.cpp
@@ -41,7 +41,7 @@ namespace
                 find_if(mHooks.begin(), mHooks.end(), IdentityComparePredicate<BridgeCreationHookPrx>(newHook));
             if (i != mHooks.end())
             {
-                mLogger(Debug) << "refreshing creation hook " << newHook << " on " 
+                mLogger(Trace) << "refreshing creation hook " << newHook << " on " 
                     << objectIdFromCurrent(current);
                 //
                 // Refresh the proxy if it is already in the vector.
@@ -50,7 +50,7 @@ namespace
             }
             else
             {
-                mLogger(Debug) << "adding creation hook " << newHook << " on " 
+                mLogger(Trace) << "adding creation hook " << newHook << " on " 
                     << objectIdFromCurrent(current);
                 mHooks.push_back(newHook);
             }
@@ -59,7 +59,7 @@ namespace
         void removeHook(const BridgeCreationHookPrx& hookToRemove, const Ice::Current& current)
         {
             UniqueLock lock(mLock);
-            mLogger(Debug) << "removing creation hook " << hookToRemove << " on " 
+            mLogger(Trace) << "removing creation hook " << hookToRemove << " on " 
                 << objectIdFromCurrent(current);
             mHooks.erase(remove_if(mHooks.begin(), mHooks.end(), 
                     IdentityComparePredicate<BridgeCreationHookPrx>(hookToRemove)), mHooks.end());
@@ -68,13 +68,13 @@ namespace
         void clearHooks(const Ice::Current& current)
         {
             UniqueLock lock(mLock);
-            mLogger(Debug) << "clearing hooks from " << objectIdFromCurrent(current);
+            mLogger(Trace) << "clearing hooks from " << objectIdFromCurrent(current);
             mHooks.clear();
         }
 
         BridgeCreationHookDataPtr runHooks(const BridgeCreationHookDataPtr& originalData)
         {
-            mLogger(Debug) << "executing hooks";
+            mLogger(Trace) << "executing hooks";
             BridgeCreationHookSeq hooks = getHooks();
             BridgeCreationHookSeq deadHooks;
             BridgeCreationHookDataPtr tokenData = BridgeCreationHookDataPtr::dynamicCast(originalData->ice_clone());
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 3dd19e4..5f2c03a 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -306,7 +306,7 @@ protected:
     {
         try
         {
-            mLogger(Debug) << FUNLOG;
+            mLogger(Trace) << FUNLOG;
 
             // Forward the ConnectedLine to each bridged session.
             SessionSeq sessions = mBridge->getSessions()->getSessionSeq();
@@ -323,7 +323,7 @@ protected:
             }
 
         }
-        catch (const std::exception e)
+        catch (const std::exception& e)
         {
             mLogger(Debug) << FUNLOG << " : " << e.what();
         }
@@ -333,7 +333,7 @@ protected:
            
     void forward(const SessionWrapperPtr destinationSession, const RedirectionsPtr& redirections)
     {
-        mLogger(Debug) << FUNLOG;
+        mLogger(Trace) << FUNLOG;
 
         RedirectionsPtr currentRedirections = redirections;
         RedirectionsPtr destSpecificRedirections = redirections;
@@ -403,7 +403,7 @@ protected:
     {
         try
         {
-            mLogger(Debug) << FUNLOG;
+            mLogger(Trace) << FUNLOG;
 
             ConnectedLinePtr currentConnectedLine;
             SessionWrapperPtr sourceWrapper = mBridge->getSessions()->getSession(mSourceSession);
@@ -430,7 +430,7 @@ protected:
             }
 
         }
-        catch (const std::exception e)
+        catch (const std::exception& e)
         {
             mLogger(Debug) << FUNLOG << " : " << e.what();
         }
@@ -440,7 +440,7 @@ protected:
            
     void forward(const SessionWrapperPtr destinationSession, const ConnectedLinePtr& connectedLine)
     {
-        mLogger(Debug) << FUNLOG;
+        mLogger(Trace) << FUNLOG;
 
         ConnectedLinePtr currentConnectedLine = connectedLine;
         ConnectedLinePtr destSpecificConnectedLine = connectedLine;
@@ -463,7 +463,7 @@ protected:
                     currentConnectedLine = destSpecificConnectedLine;
                 }
             }
-            catch (const std::exception e)
+            catch (const std::exception& e)
             {
                 mLogger(Debug) << FUNLOG << " : " << e.what();
             }
@@ -499,7 +499,7 @@ protected:
     {
         try
         {
-            mLogger(Debug) << FUNLOG;
+            mLogger(Trace) << FUNLOG;
 
             // Forward the Caller to each bridged session.
             SessionSeq sessions = mBridge->getSessions()->getSessionSeq();
@@ -516,7 +516,7 @@ protected:
             }
 
         }
-        catch (const std::exception e)
+        catch (const std::exception& e)
         {
             mLogger(Debug) << FUNLOG << " : " << e.what();
         }
@@ -526,7 +526,7 @@ protected:
            
     void forward(const SessionWrapperPtr destinationSession, const CallerPtr& callerID)
     {
-        mLogger(Debug) << FUNLOG;
+        mLogger(Trace) << FUNLOG;
 
         CallerPtr currentCallerID = callerID;
         CallerPtr destSpecificCallerID = callerID;
@@ -549,7 +549,7 @@ protected:
                     currentCallerID = destSpecificCallerID;
                 }
             }
-            catch (const std::exception e)
+            catch (const std::exception& e)
             {
                 mLogger(Debug) << FUNLOG << " : " << e.what();
             }
@@ -588,7 +588,7 @@ public:
 protected:
     bool executeImpl()
     {
-        mLogger(Debug) << FUNLOG;
+        mLogger(Trace) << FUNLOG;
 
         ConnectedLinePtr currentConnectedLine = mConnectedLine;
         ConnectedLinePtr updatedConnectedLine = mConnectedLine;
@@ -611,7 +611,7 @@ protected:
                     currentConnectedLine = updatedConnectedLine;
                 }
             }
-            catch (const std::exception e)
+            catch (const std::exception& e)
             {
                 mLogger(Debug) << FUNLOG << " : " << e.what();
             }
@@ -1300,7 +1300,7 @@ void BridgeImpl::updateConnectedLine(const SessionWrapperPtr& sourceSession, con
         ExecutorPtr runner(new Executor(tasks, mLogger));
         runner->start();
     }
-    catch (const std::exception e)
+    catch (const std::exception& e)
     {
         mLogger(Debug) << FUNLOG << " : " << e.what();
     }
@@ -1321,7 +1321,7 @@ void BridgeImpl::updateRedirections(const SessionWrapperPtr& sourceSession, cons
         ExecutorPtr runner(new Executor(tasks, mLogger));
         runner->start();
     }
-    catch (const std::exception e)
+    catch (const std::exception& e)
     {
         mLogger(Debug) << FUNLOG << " : " << e.what();
     }
@@ -1816,7 +1816,7 @@ void BridgeImpl::activate(const BridgePrx& proxy, const std::string& bridgeId)
     mState->key = bridgeId;
     mState->bridgeId = bridgeId;
     string listenerId = bridgeId + ".sessionListener"; 
-    mLogger(Debug) << FUNLOG << " : activating session listener with " << listenerId;
+    mLogger(Trace) << FUNLOG << " : activating session listener with " << listenerId;
     mActivated = true;
     mSessionListenerPrx =
         SessionListenerPrx::uncheckedCast(
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index 4ec541d..18fd3da 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -267,7 +267,10 @@ void BridgeManagerImpl::createBridge_async(const AMD_BridgeManager_createBridgeP
             listeners = hookData->listeners;
             initialSessions = hookData->initialSessions;
             info.decoratingPrx = hookData->bridge;
-            dump(mLogger, hookData);
+            if (mLogger.isEnabledFor(Trace))
+            {
+                dump(mLogger, hookData);
+            }
         }
         
         //
diff --git a/src/BridgeReplicatorStateListenerI.cpp b/src/BridgeReplicatorStateListenerI.cpp
index ecdbf20..fcbd5bf 100644
--- a/src/BridgeReplicatorStateListenerI.cpp
+++ b/src/BridgeReplicatorStateListenerI.cpp
@@ -50,7 +50,7 @@ public:
             if (entry != mItems.end())
             {
                 ReplicatedStateItemPtr item = entry->second;
-                mLogger(Debug) << " received removal of " << (*k) << ": a " << item->ice_id();
+                mLogger(Trace) << " received removal of " << (*k) << ": a " << item->ice_id();
 
                 mItems.erase(entry);
                 BridgedSessionPtr bridgedSessionItem = BridgedSessionPtr::dynamicCast(item);
@@ -96,7 +96,10 @@ public:
                 BridgeStateItemPtr bridgeItem = BridgeStateItemPtr::dynamicCast(item);
                 if (bridgeItem)
                 {
-                    dumpState(cerr, bridgeItem, current.adapter->getCommunicator());
+                    if (mLogger.isEnabledFor(Trace))
+                    {
+                        dumpState(cerr, bridgeItem, current.adapter->getCommunicator());
+                    }
                     mManager->removeBridge(bridgeItem);
                     continue;
                 }
@@ -161,7 +164,10 @@ public:
             BridgeStateItemPtr bridgeItem = BridgeStateItemPtr::dynamicCast((*i));
             if (bridgeItem)
             {
-                dumpState(cerr, bridgeItem, current.adapter->getCommunicator());
+                if (mLogger.isEnabledFor(Trace))
+                {
+                    dumpState(cerr, bridgeItem, current.adapter->getCommunicator());
+                }
                 vector<BridgeServantPtr> bridges = mManager->getBridges();
                 bool found = false;
                 for (vector<BridgeServantPtr>::iterator b = bridges.begin(); b != bridges.end(); ++b)
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index 27411cc..f1a39aa 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -588,13 +588,13 @@ public:
 
             if (existingMixer == mixers.end())
             {
-                mLogger(Debug) << FUNLOG << ": creating media mixer for format " << format;
+                mLogger(Trace) << FUNLOG << ": creating media mixer for format " << format;
                 mixer = new MediaMixer(mAdapter, stream->second->formats.front());
                 mMediaMixers.insert(make_pair(format, mixer));
 	    }
 	    else
 	    {
-		mLogger(Debug) << FUNLOG << ": using found media mixer for format " << format;
+		mLogger(Trace) << FUNLOG << ": using found media mixer for format " << format;
 		mixer = existingMixer->second;
                 mixers.erase(format);
 	    }
diff --git a/src/SessionListener.cpp b/src/SessionListener.cpp
index 9062ca6..c6571e3 100644
--- a/src/SessionListener.cpp
+++ b/src/SessionListener.cpp
@@ -124,7 +124,7 @@ public:
 	if ((connected = AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr::dynamicCast(indication)))
 	{
 	    string proxyString = source->ice_toString();
-	    mLogger(Debug) << FUNLOG << ": session connected " << proxyString;
+	    mLogger(Trace) << FUNLOG << ": session connected " << proxyString;
             mSessions->reap();
 	    try
 	    {
@@ -150,7 +150,7 @@ public:
 	else if ((stopped = AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr::dynamicCast(indication)))
 	{
 	    string proxyString = source->ice_toString();
-	    mLogger(Debug) << FUNLOG << ": session stopped " << proxyString;
+	    mLogger(Trace) << FUNLOG << ": session stopped " << proxyString;
 
 	    //
 	    // IMPLNOTE: The AMI approach.

-----------------------------------------------------------------------


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list