Fix various logging related issues.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
index 641faaf..e94d948 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
@@ -140,7 +140,7 @@
case FLOW_REMOVED:
OFFlowRemoved flowMsg = (OFFlowRemoved) msg;
FlowEntryId id = new FlowEntryId(flowMsg.getCookie());
- log.debug("Got flow entry removed from " + sw.getId() + ": " + id);
+ log.debug("Got flow entry removed from {}: {}",sw.getId(), id);
flowManager.flowEntryOnSwitchExpired(sw, id);
break;
default:
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
index 4529382..f2a1828 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
@@ -505,7 +505,7 @@
// Unknown user state. Ignore the entry
log.debug(
"Flow Entry ignored (FlowEntryId = {}): unknown user state {}",
- flowEntry.flowEntryId().toString(),
+ flowEntry.flowEntryId(),
flowEntry.flowEntryUserState());
return false;
}
@@ -747,13 +747,16 @@
//
// Write the message to the switch
//
- log.debug("Installing flow entry "
- + flowEntry.flowEntryUserState() + " into switch DPID: "
- + sw.getStringId() + " flowEntryId: "
- + flowEntry.flowEntryId().toString() + " srcMac: "
- + matchSrcMac + " dstMac: " + matchDstMac + " inPort: "
- + matchInPort + " outPort: " + actionOutputPort);
-
+ log.debug("Installing flow entry {} into switch DPID: {} flowEntryId: {} srcMac: {} dstMac: {} inPort: {} outPort: {}"
+ , flowEntry.flowEntryUserState()
+ , sw.getStringId()
+ , flowEntry.flowEntryId()
+ , matchSrcMac
+ , matchDstMac
+ , matchInPort
+ , actionOutputPort
+ );
+
return add(sw, fm);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
index 6ef44be..740e782 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
@@ -124,14 +124,14 @@
extractTime /= div;
pushTime /= div;
totalTime /= div;
- log.debug("Sync time (ms):" +
- graphIDTime + "," +
- switchTime + "," +
- compareTime + "," +
- graphEntryTime + "," +
- extractTime + "," +
- pushTime + "," +
- totalTime);
+ log.debug("Sync time (ms):{},{},{},{},{},{},{}"
+ , graphIDTime
+ , switchTime
+ , compareTime
+ , graphEntryTime
+ , extractTime
+ , pushTime
+ , totalTime);
}
/**
@@ -161,11 +161,14 @@
extractTime += entry.extractTime;
pushTime += entry.pushTime;
added++;
- }
- log.debug("Flow entries added "+ added + ", " +
- "Flow entries removed "+ removed + ", " +
- "Flow entries skipped " + skipped);
-
+ }
+ log.debug("Flow entries added {}, " +
+ "Flow entries removed {}, " +
+ "Flow entries skipped {}"
+ , added
+ , removed
+ , skipped );
+
return new SyncResult(added, removed, skipped);
}
@@ -258,7 +261,7 @@
double dbTime, extractTime, pushTime;
public void addToSwitch(IOFSwitch sw) {
if (statisticsReply != null) {
- log.error("Error adding existing flow entry {} to sw {}",
+ log.error("Error adding existing flow entry {} to sw {}",
statisticsReply.getCookie(), sw.getId());
return;
}
@@ -289,19 +292,19 @@
return;
}
extractTime = System.nanoTime() - startExtract;
-
+
double startPush = System.nanoTime();
pusher.pushFlowEntry(sw, flowEntry);
pushTime = System.nanoTime() - startPush;
}
-
+
/**
* Remove this FlowEntry from a switch via FlowPusher.
* @param sw Switch from which flow will be removed.
*/
public void removeFromSwitch(IOFSwitch sw) {
if (statisticsReply == null) {
- log.error("Error removing non-existent flow entry {} from sw {}",
+ log.error("Error removing non-existent flow entry {} from sw {}",
flowEntryId, sw.getId());
return;
}