Merge "new LinkedList() mostly redundant with Arrays.asList()"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / packet / Packet.java
index cdf15322e354f7e6a808bf7912666ee6a4fd5ad7..446ec3e230e8bd11d0b9dc7451f8824b12adfda6 100644 (file)
@@ -109,6 +109,13 @@ public abstract class Packet {
              * Store the raw read value, checks the payload type and set the
              * payloadClass accordingly
              */
+            if (logger.isTraceEnabled()) {
+              logger.trace("{}: {}: {} (offset {} bitsize {})",
+                      new Object[] { this.getClass().getSimpleName(), hdrField,
+                              HexEncode.bytesToHexString(hdrFieldBytes),
+                              startOffset, numBits });
+            }
+
             this.setHeaderField(hdrField, hdrFieldBytes);
         }
 
@@ -138,7 +145,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 +191,10 @@ public abstract class Packet {
         }
         postSerializeCustomOperation(headerBytes);
 
+        if (logger.isTraceEnabled()) {
+          logger.trace("{}: {}", this.getClass().getSimpleName(),
+                  HexEncode.bytesToHexString(headerBytes));
+        }
         return headerBytes;
     }