Logging enhancement related to Packet
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / packet / LLDP.java
index 1a0033ee963ebb1a4ec01c7923cece40dea0bdf9..5e7a214f0ea9d723c641c157b6c187b1fd59b87b 100644 (file)
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import org.opendaylight.controller.sal.utils.HexEncode;
 import org.opendaylight.controller.sal.utils.NetUtils;
 
 /**
@@ -170,6 +171,8 @@ public class LLDP extends Packet {
         int lldpOffset = bitOffset; // LLDP start
         int lldpSize = size; // LLDP size
 
+        logger.trace("LLDP: {} (offset {} bitsize {})", new Object[] {
+                HexEncode.bytesToHexString(data), lldpOffset, lldpSize });
         /*
          * Deserialize the TLVs until we reach the end of the packet
          */
@@ -209,6 +212,8 @@ public class LLDP extends Packet {
             throw new PacketException(e.getMessage());
         }
 
+        logger.trace("LLDP: serialized: {}",
+                HexEncode.bytesToHexString(serializedBytes));
         return serializedBytes;
     }