Skip to content

Commit

Permalink
Add logging of hex representation
Browse files Browse the repository at this point in the history
Signed-off-by: Gerben Kroes <[email protected]>
  • Loading branch information
kroesctrl committed Oct 25, 2023
1 parent 5afd5aa commit 1c9d236
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Map;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Hex;
import org.opensmartgridplatform.dlms.DlmsPushNotification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.annotation.MessageEndpoint;
Expand All @@ -28,7 +29,10 @@ public class UdpInboundMessageHandler {
public void handeMessage(final Message message, @Headers final Map<String, Object> headerMap)
throws UnrecognizedMessageDataException {
final byte[] payload = (byte[]) message.getPayload();
log.info("Received UDP message: {}", new String(payload));
log.info(
"Received UDP message: {}, hex-representation: {}",
new String(payload),
Hex.encodeHexString(payload));

final DlmsPushNotification dlmsPushNotification =
this.decoder.decode(payload, ConnectionProtocol.UDP);
Expand Down

0 comments on commit 1c9d236

Please sign in to comment.