Logging enhancement related to Packet
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / packet / Packet.java
index cdf15322e354f7e6a808bf7912666ee6a4fd5ad7..95f0ca8617cf8d5951ac616393abebeab51acbc0 100644 (file)
@@ -109,6 +109,11 @@ public abstract class Packet {
              * Store the raw read value, checks the payload type and set the
              * payloadClass accordingly
              */
+            logger.trace("{}: {}: {} (offset {} bitsize {})",
+                    new Object[] { this.getClass().getSimpleName(), hdrField,
+                            HexEncode.bytesToHexString(hdrFieldBytes),
+                            startOffset, numBits });
+
             this.setHeaderField(hdrField, hdrFieldBytes);
         }
 
@@ -138,7 +143,7 @@ public abstract class Packet {
      * packet class, into a single stream of bytes to be sent on the wire
      * 
      * @return byte[] - serialized bytes
-     * @throws PacketException 
+     * @throws PacketException
      */
 
     public byte[] serialize() throws PacketException {
@@ -184,6 +189,8 @@ public abstract class Packet {
         }
         postSerializeCustomOperation(headerBytes);
 
+        logger.trace("{}: {}", this.getClass().getSimpleName(),
+                HexEncode.bytesToHexString(headerBytes));
         return headerBytes;
     }