Skip to content

Commit

Permalink
Issue #5121 - always use isDebugEnabled() check before debug logging
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Aug 6, 2020
1 parent e3cdebb commit 4d42069
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Expand Up @@ -143,15 +143,17 @@ public boolean isRsv3User()

protected void nextIncomingFrame(Frame frame)
{
log.debug("nextIncomingFrame({})", frame);
if (log.isDebugEnabled())
log.debug("nextIncomingFrame({})", frame);
this.nextIncoming.incomingFrame(frame);
}

protected void nextOutgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
{
try
{
log.debug("nextOutgoingFrame({})", frame);
if (log.isDebugEnabled())
log.debug("nextOutgoingFrame({})", frame);
this.nextOutgoing.outgoingFrame(frame, callback, batchMode);
}
catch (Throwable t)
Expand Down
Expand Up @@ -230,17 +230,20 @@ public void negotiate(List<ExtensionConfig> configs)
// Check RSV
if (ext.isRsv1User() && (rsvClaims[0] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV1", config, rsvClaims[0]);
if (LOG.isDebugEnabled())
LOG.debug("Not adding extension {}. Extension {} already claimed RSV1", config, rsvClaims[0]);
continue;
}
if (ext.isRsv2User() && (rsvClaims[1] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV2", config, rsvClaims[1]);
if (LOG.isDebugEnabled())
LOG.debug("Not adding extension {}. Extension {} already claimed RSV2", config, rsvClaims[1]);
continue;
}
if (ext.isRsv3User() && (rsvClaims[2] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV3", config, rsvClaims[2]);
if (LOG.isDebugEnabled())
LOG.debug("Not adding extension {}. Extension {} already claimed RSV3", config, rsvClaims[2]);
continue;
}

Expand Down Expand Up @@ -445,7 +448,8 @@ private void notifyCallbackSuccess(WriteCallback callback)
}
catch (Throwable x)
{
LOG.debug("Exception while notifying success of callback " + callback, x);
if (LOG.isDebugEnabled())
LOG.debug("Exception while notifying success of callback " + callback, x);
}
}

Expand All @@ -458,7 +462,8 @@ private void notifyCallbackFailure(WriteCallback callback, Throwable failure)
}
catch (Throwable x)
{
LOG.debug("Exception while notifying failure of callback " + callback, x);
if (LOG.isDebugEnabled())
LOG.debug("Exception while notifying failure of callback " + callback, x);
}
}
}
Expand Down
Expand Up @@ -130,10 +130,12 @@ protected Action process()
current = pollEntry();
if (current == null)
{
LOG.debug("Processing IDLE", current);
if (LOG.isDebugEnabled())
LOG.debug("Processing IDLE", current);
return Action.IDLE;
}
LOG.debug("Processing {}", current);
if (LOG.isDebugEnabled())
LOG.debug("Processing {}", current);
fragment(current, true);
}
else
Expand Down

0 comments on commit 4d42069

Please sign in to comment.