Skip to content

Commit

Permalink
Minor logging tweaks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cfredri4 committed Nov 14, 2024
1 parent 32998fc commit 3468548
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/org/jgroups/protocols/NAKACK4.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/org/jgroups/protocols/UNICAST4.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/org/jgroups/protocols/UnicastHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
3 changes: 2 additions & 1 deletion src/org/jgroups/protocols/UnicastHeader3.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 3468548

Please sign in to comment.