Include the local username fragment in various log messages.

This commit is contained in:
Boris Grozev 2016-07-05 16:10:34 -05:00
parent dc29172a2c
commit 27f6f62c27
4 changed files with 32 additions and 21 deletions

View File

@ -488,8 +488,8 @@ public class Agent
throws IllegalArgumentException, throws IllegalArgumentException,
IOException IOException
{ {
logger.info("Gather candidates for component " + logger.info("Gathering candidates for component " +
component.toShortString()); component.toShortString() +". Local ufrag " + getLocalUfrag());
if (useHostHarvester()) if (useHostHarvester())
{ {
@ -579,7 +579,8 @@ public class Agent
{ {
synchronized(startLock) synchronized(startLock)
{ {
logger.info("Start ICE connectivity establishment"); logger.info("Start ICE connectivity establishment. Local ufrag "
+ getLocalUfrag());
shutdown = false; shutdown = false;
pruneNonMatchedStreams(); pruneNonMatchedStreams();
@ -790,7 +791,7 @@ public class Agent
if (!oldState.equals(newState)) if (!oldState.equals(newState))
{ {
logger.info("ICE state changed from " + oldState + " to " logger.info("ICE state changed from " + oldState + " to "
+ newState); + newState + ". Local ufrag " + getLocalUfrag());
fireStateChange(oldState, newState); fireStateChange(oldState, newState);
return true; return true;
@ -1499,8 +1500,9 @@ public class Agent
//so it's now safe to go and see whether this is a new PR cand. //so it's now safe to go and see whether this is a new PR cand.
if(triggeredPair.getParentComponent().getSelectedPair() == null) if(triggeredPair.getParentComponent().getSelectedPair() == null)
{ {
logger.info("Received check from " + logger.info("Received check from "
triggeredPair.toShortString() + " triggered a check"); + triggeredPair.toShortString() + " triggered a check. "
+ "Local ufrag " + getLocalUfrag());
} }
triggerCheck(triggeredPair); triggerCheck(triggeredPair);
} }
@ -1820,7 +1822,8 @@ public class Agent
StringBuffer buf StringBuffer buf
= new StringBuffer( "Harvester used for selected pair for "); = new StringBuffer( "Harvester used for selected pair for ");
buf.append(component.toShortString()); buf.append(component.toShortString());
buf.append(": "); buf.append(" (local ufrag ").append(getLocalUfrag());
buf.append("): ");
if(selectedPair == null) if(selectedPair == null)
{ {

View File

@ -41,7 +41,7 @@ public class Component
* Our class logger. * Our class logger.
* Note that this shouldn't be used directly by instances of * Note that this shouldn't be used directly by instances of
* {@link IceMediaStream}, because it doesn't take into account the * {@link IceMediaStream}, because it doesn't take into account the
* per-instance log level. Instances should use {@link #logger} instead. * per-instance log level.updateRemoteCandidates Instances should use {@link #logger} instead.
*/ */
private static final java.util.logging.Logger classLogger private static final java.util.logging.Logger classLogger
= java.util.logging.Logger.getLogger(Component.class.getName()); = java.util.logging.Logger.getLogger(Component.class.getName());
@ -357,7 +357,9 @@ public class Component
= getParentStream() = getParentStream()
.getParentAgent() .getParentAgent()
.createCandidatePair(localCnd, remoteCnd); .createCandidatePair(localCnd, remoteCnd);
logger.info("new Pair added: " + pair.toShortString()); logger.info("new Pair added: " + pair.toShortString()
+ ". Local ufrag "
+ parentStream.getParentAgent().getLocalUfrag());
checkList.add(pair); checkList.add(pair);
} }
} }

View File

@ -126,7 +126,8 @@ class ConnectivityCheckClient
if (streamsWithPendingConnectivityEstablishment.size() > 0) if (streamsWithPendingConnectivityEstablishment.size() > 0)
{ {
logger.info("Start connectivity checks!"); logger.info("Start connectivity checks. Local ufrag "
+ parentAgent.getLocalUfrag());
startChecks( startChecks(
streamsWithPendingConnectivityEstablishment streamsWithPendingConnectivityEstablishment
.get(0).getCheckList()); .get(0).getCheckList());
@ -501,7 +502,8 @@ class ConnectivityCheckClient
logger.fine("Received a success response with no " logger.fine("Received a success response with no "
+ "XOR_MAPPED_ADDRESS attribute."); + "XOR_MAPPED_ADDRESS attribute.");
logger.info("Pair failed (no XOR-MAPPED-ADDRESS): " logger.info("Pair failed (no XOR-MAPPED-ADDRESS): "
+ checkedPair.toShortString()); + checkedPair.toShortString() + ". Local ufrag"
+ parentAgent.getLocalUfrag());
checkedPair.setStateFailed(); checkedPair.setStateFailed();
return; //malformed error response return; //malformed error response
} }
@ -569,9 +571,9 @@ class ConnectivityCheckClient
if (checkedPair.getParentComponent().getSelectedPair() == null) if (checkedPair.getParentComponent().getSelectedPair() == null)
{ {
logger.info( logger.info("Receive a peer-reflexive candidate: "
"Receive a peer-reflexive candidate: " + peerReflexiveCandidate.getTransportAddress()
+ peerReflexiveCandidate.getTransportAddress()); + ". Local ufrag " + parentAgent.getLocalUfrag());
} }
} }
@ -607,14 +609,16 @@ class ConnectivityCheckClient
//Succeeded. Note that, the pair which *generated* the check may be //Succeeded. Note that, the pair which *generated* the check may be
//different than the valid pair constructed above //different than the valid pair constructed above
if (checkedPair.getParentComponent().getSelectedPair() == null) if (checkedPair.getParentComponent().getSelectedPair() == null)
logger.info("Pair succeeded: " + checkedPair.toShortString()); logger.info("Pair succeeded: " + checkedPair.toShortString()
+ ". Local ufrag " + parentAgent.getLocalUfrag());
checkedPair.setStateSucceeded(); checkedPair.setStateSucceeded();
} }
if (!validPair.isValid()) if (!validPair.isValid())
{ {
if (validPair.getParentComponent().getSelectedPair() == null) if (validPair.getParentComponent().getSelectedPair() == null)
logger.info("Pair validated: " + validPair.toShortString()); logger.info("Pair validated: " + validPair.toShortString()
+ ". Local ufrag " + parentAgent.getLocalUfrag());
parentAgent.validatePair(validPair); parentAgent.validatePair(validPair);
} }
@ -685,7 +689,8 @@ class ConnectivityCheckClient
logger.info("IsControlling: " + parentAgent.isControlling() + logger.info("IsControlling: " + parentAgent.isControlling() +
" USE-CANDIDATE:" + " USE-CANDIDATE:" +
(request.containsAttribute(Attribute.USE_CANDIDATE) || (request.containsAttribute(Attribute.USE_CANDIDATE) ||
checkedPair.useCandidateSent())); checkedPair.useCandidateSent())
+ ". Local ufrag " + parentAgent.getLocalUfrag());
} }
//If the agent was a controlling agent, and it had included a USE- //If the agent was a controlling agent, and it had included a USE-
@ -696,9 +701,9 @@ class ConnectivityCheckClient
{ {
if(validPair.getParentComponent().getSelectedPair() == null) if(validPair.getParentComponent().getSelectedPair() == null)
{ {
logger.info( logger.info("Nomination confirmed for pair: "
"Nomination confirmed for pair: " + validPair.toShortString()
+ validPair.toShortString()); + ". Loal ufrag " + parentAgent.getLocalUfrag());
parentAgent.nominationConfirmed( validPair ); parentAgent.nominationConfirmed( validPair );
} }
else else

View File

@ -145,7 +145,8 @@ public class DefaultNominator
{ {
CandidatePair validPair = (CandidatePair)evt.getSource(); CandidatePair validPair = (CandidatePair)evt.getSource();
logger.info("Nominate (first valid): " + validPair.toShortString()); logger.info("Nominate (first valid): " + validPair.toShortString()
+ ". Local ufrag " + parentAgent.getLocalUfrag());
parentAgent.nominate(validPair); parentAgent.nominate(validPair);
} }
} }