Committed by
Gerrit Code Review
Log more info when inter-Node messaging fails.
Change-Id: Ifd749a3023854d688a675c7279c27868b8bed436
Showing
2 changed files
with
14 additions
and
1 deletions
... | @@ -194,7 +194,7 @@ public class ClusterCommunicationManager | ... | @@ -194,7 +194,7 @@ public class ClusterCommunicationManager |
194 | try { | 194 | try { |
195 | clusterMessage = SERIALIZER.decode(message.payload()); | 195 | clusterMessage = SERIALIZER.decode(message.payload()); |
196 | } catch (Exception e) { | 196 | } catch (Exception e) { |
197 | - log.error("Failed decoding ClusterMessage", e); | 197 | + log.error("Failed decoding ClusterMessage {}", message, e); |
198 | throw e; | 198 | throw e; |
199 | } | 199 | } |
200 | try { | 200 | try { | ... | ... |
... | @@ -17,6 +17,10 @@ package org.onlab.netty; | ... | @@ -17,6 +17,10 @@ package org.onlab.netty; |
17 | 17 | ||
18 | import java.io.IOException; | 18 | import java.io.IOException; |
19 | 19 | ||
20 | +import org.onlab.util.ByteArraySizeHashPrinter; | ||
21 | + | ||
22 | +import com.google.common.base.MoreObjects; | ||
23 | + | ||
20 | /** | 24 | /** |
21 | * Internal message representation with additional attributes | 25 | * Internal message representation with additional attributes |
22 | * for supporting, synchronous request/reply behavior. | 26 | * for supporting, synchronous request/reply behavior. |
... | @@ -73,6 +77,15 @@ public final class InternalMessage implements Message { | ... | @@ -73,6 +77,15 @@ public final class InternalMessage implements Message { |
73 | messagingService.sendAsync(sender, message); | 77 | messagingService.sendAsync(sender, message); |
74 | } | 78 | } |
75 | 79 | ||
80 | + @Override | ||
81 | + public String toString() { | ||
82 | + return MoreObjects.toStringHelper(this) | ||
83 | + .add("id", id) | ||
84 | + .add("type", type) | ||
85 | + .add("sender", sender) | ||
86 | + .add("payload", ByteArraySizeHashPrinter.of(payload)) | ||
87 | + .toString(); | ||
88 | + } | ||
76 | 89 | ||
77 | /** | 90 | /** |
78 | * Builder for InternalMessages. | 91 | * Builder for InternalMessages. | ... | ... |
-
Please register or login to post a comment