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
…in WebSocket

Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Aug 6, 2020
1 parent 4d42069 commit e42b41a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ public void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMo
}
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);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ protected void nextIncomingFrame(Frame frame)
{
if (frame.isFin() && !incomingContextTakeover)
{
LOG.debug("Incoming Context Reset");
if (LOG.isDebugEnabled())
LOG.debug("Incoming Context Reset");
decompressCount.set(0);
getInflater().reset();
}
Expand All @@ -117,7 +118,8 @@ protected void nextOutgoingFrame(Frame frame, WriteCallback callback, BatchMode
{
if (frame.isFin() && !outgoingContextTakeover)
{
LOG.debug("Outgoing Context Reset");
if (LOG.isDebugEnabled())
LOG.debug("Outgoing Context Reset");
getDeflater().reset();
}
super.nextOutgoingFrame(frame, callback, batchMode);
Expand Down Expand Up @@ -188,7 +190,8 @@ public void setConfig(final ExtensionConfig config)
}
}

LOG.debug("config: outgoingContextTakeover={}, incomingContextTakeover={} : {}", outgoingContextTakeover, incomingContextTakeover, this);
if (LOG.isDebugEnabled())
LOG.debug("config: outgoingContextTakeover={}, incomingContextTakeover={} : {}", outgoingContextTakeover, incomingContextTakeover, this);

super.setConfig(configNegotiated);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
if (configuration == null)
{
// no configuration, cannot operate
LOG.debug("WebSocketUpgradeFilter is not operational - missing " + NativeWebSocketConfiguration.class.getName());
if (LOG.isDebugEnabled())
LOG.debug("WebSocketUpgradeFilter is not operational - missing " + NativeWebSocketConfiguration.class.getName());
chain.doFilter(request, response);
return;
}
Expand All @@ -210,7 +211,8 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
if (factory == null)
{
// no factory, cannot operate
LOG.debug("WebSocketUpgradeFilter is not operational - no WebSocketServletFactory configured");
if (LOG.isDebugEnabled())
LOG.debug("WebSocketUpgradeFilter is not operational - no WebSocketServletFactory configured");
chain.doFilter(request, response);
return;
}
Expand Down

0 comments on commit e42b41a

Please sign in to comment.