From 3468548024e30a67b77e525ec394f7cadafd373e Mon Sep 17 00:00:00 2001 From: cfredri4 Date: Thu, 14 Nov 2024 09:32:45 +0100 Subject: [PATCH] Minor logging tweaks This change makes UnicastHeader/3 toString() consistent with most other headers by wrapping in "[]" And changes two logs for new UNICAST4/NAKACK4 to debug to not be logged by default --- src/org/jgroups/protocols/NAKACK4.java | 2 +- src/org/jgroups/protocols/UNICAST4.java | 2 +- src/org/jgroups/protocols/UnicastHeader.java | 3 ++- src/org/jgroups/protocols/UnicastHeader3.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/jgroups/protocols/NAKACK4.java b/src/org/jgroups/protocols/NAKACK4.java index f0da9280bbb..280999b4425 100644 --- a/src/org/jgroups/protocols/NAKACK4.java +++ b/src/org/jgroups/protocols/NAKACK4.java @@ -92,7 +92,7 @@ public void init() throws Exception { super.init(); if(ack_threshold <= 0) { ack_threshold=capacity / 4; - log.info("defaulted ack_threshold to %d", ack_threshold); + log.debug("defaulted ack_threshold to %d", ack_threshold); } } diff --git a/src/org/jgroups/protocols/UNICAST4.java b/src/org/jgroups/protocols/UNICAST4.java index dfe1b38323d..4f078d1d4f5 100644 --- a/src/org/jgroups/protocols/UNICAST4.java +++ b/src/org/jgroups/protocols/UNICAST4.java @@ -93,7 +93,7 @@ public void init() throws Exception { super.init(); if(ack_threshold <= 0) { ack_threshold=capacity / 4; - log.info("defaulted ack_threshold to %d", ack_threshold); + log.debug("defaulted ack_threshold to %d", ack_threshold); } } diff --git a/src/org/jgroups/protocols/UnicastHeader.java b/src/org/jgroups/protocols/UnicastHeader.java index 09b2469c05b..6f72c50f082 100644 --- a/src/org/jgroups/protocols/UnicastHeader.java +++ b/src/org/jgroups/protocols/UnicastHeader.java @@ -77,12 +77,13 @@ public static UnicastHeader createCloseHeader(short conn_id) { public UnicastHeader timestamp(int ts) {timestamp=ts; return this;} public String toString() { - StringBuilder sb=new StringBuilder(); + StringBuilder sb=new StringBuilder("["); sb.append(type2Str(type)).append(", seqno=").append(seqno); sb.append(", conn_id=").append(conn_id); if(first) sb.append(", first"); if(timestamp != 0) sb.append(", ts=").append(timestamp); + sb.append("]"); return sb.toString(); } diff --git a/src/org/jgroups/protocols/UnicastHeader3.java b/src/org/jgroups/protocols/UnicastHeader3.java index f5b372acf87..14187d8fb70 100644 --- a/src/org/jgroups/protocols/UnicastHeader3.java +++ b/src/org/jgroups/protocols/UnicastHeader3.java @@ -76,12 +76,13 @@ public static UnicastHeader3 createCloseHeader(short conn_id) { public UnicastHeader3 timestamp(int ts) {timestamp=ts; return this;} public String toString() { - StringBuilder sb=new StringBuilder(); + StringBuilder sb=new StringBuilder("["); sb.append(type2Str(type)).append(", seqno=").append(seqno); if(conn_id != 0) sb.append(", conn_id=").append(conn_id); if(first) sb.append(", first"); if(timestamp != 0) sb.append(", ts=").append(timestamp); + sb.append("]"); return sb.toString(); }