Logging improvements to improve efficiency - specifically in critical path.
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / DataPacketMuxDemux.java
index a8ebcb068b9399f0fee0c6b8dd6370e3b810b4d2..7614a4d128eae867ed4378f78e346da447c4d081 100644 (file)
@@ -195,13 +195,15 @@ public class DataPacketMuxDemux implements IContainerListener,
                         .get(GlobalConstants.DEFAULT.toString());
                 if (defaultOutService != null) {
                     defaultOutService.receiveDataPacket(dataPacket);
-                    logger.trace(
-                            "Dispatched to apps a frame of size: {} on container: {}: {}",
-                            new Object[] {
+                    if (logger.isTraceEnabled()) {
+                      logger.trace(
+                              "Dispatched to apps a frame of size: {} on " +
+                              "container: {}: {}", new Object[] {
                                     ofPacket.getPacketData().length,
                                     GlobalConstants.DEFAULT.toString(),
                                     HexEncode.bytesToHexString(dataPacket
                                             .getPacketData()) });
+                    }
                 }
                 // Now check the mapping between nodeConnector and
                 // Container and later on optimally filter based on
@@ -215,15 +217,15 @@ public class DataPacketMuxDemux implements IContainerListener,
                         if (s != null) {
                             // TODO add filtering on a per-flowSpec base
                             s.receiveDataPacket(dataPacket);
-                            logger.trace(
-                                    "Dispatched to apps a frame of size: {} on container: {}: {}",
-                                    new Object[] {
+                            if (logger.isTraceEnabled()) {
+                              logger.trace(
+                                      "Dispatched to apps a frame of size: {}" +
+                                      " on container: {}: {}", new Object[] {
                                             ofPacket.getPacketData().length,
-                                            GlobalConstants.DEFAULT.toString(),
-                                            HexEncode
-                                                    .bytesToHexString(dataPacket
-                                                            .getPacketData()) });
-
+                                            container,
+                                            HexEncode.bytesToHexString(dataPacket
+                                                    .getPacketData()) });
+                            }
                         }
                     }
                 }