Some logging rework/repair

This commit is contained in:
Joakim Erdfelt 2012-07-30 12:39:30 -07:00
parent 9999db9c94
commit f34d74ec84
3 changed files with 17 additions and 6 deletions

View File

@ -84,7 +84,7 @@ public abstract class FrameBytes<C> implements Callback<C>, Runnable
}
catch (IOException e)
{
WebSocketAsyncConnection.LOG.ignore(e);
LOG.ignore(e);
}
failed(context, new InterruptedByTimeoutException());
}

View File

@ -49,7 +49,8 @@ import org.eclipse.jetty.websocket.protocol.WebSocketFrame;
*/
public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection implements RawConnection, OutgoingFrames
{
static final Logger LOG = Log.getLogger(WebSocketAsyncConnection.class);
private static final Logger LOG = Log.getLogger(WebSocketAsyncConnection.class);
private static final Logger LOG_FRAMES = Log.getLogger("org.eclipse.jetty.websocket.io.Frames");
private final ByteBufferPool bufferPool;
private final ScheduledExecutorService scheduler;
@ -135,6 +136,10 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
}
flushing = true;
if (LOG.isDebugEnabled())
{
LOG.debug("Flushing {}, {} frame(s) in queue",frameBytes,queue.size());
}
}
write(buffer,this,frameBytes);
}
@ -211,7 +216,7 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
boolean readMore = false;
try
{
readMore = read(buffer) == 0;
readMore = (read(buffer) != -1);
}
finally
{
@ -342,9 +347,9 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
{
AsyncEndPoint endpoint = getEndPoint();
if (LOG.isDebugEnabled())
if (LOG_FRAMES.isDebugEnabled())
{
LOG.debug("Writing {} frame bytes of {}",buffer.remaining(),frameBytes);
LOG_FRAMES.debug("{} Writing {} frame bytes of {}",policy.getBehavior(),buffer.remaining(),frameBytes);
}
try
{

View File

@ -42,6 +42,8 @@ public class Parser
PAYLOAD
}
private static final Logger LOG_FRAMES = Log.getLogger("org.eclipse.jetty.websocket.io.Frames");
// State specific
private State state = State.START;
private int cursor = 0;
@ -107,9 +109,13 @@ public class Parser
protected void notifyFrame(final WebSocketFrame f)
{
if (LOG_FRAMES.isDebugEnabled())
{
LOG_FRAMES.debug("{} Read Frame: {}",policy.getBehavior(),f);
}
if (LOG.isDebugEnabled())
{
LOG.debug("{} Notify Frame: {} to {}",policy.getBehavior(),f,incomingFramesHandler);
LOG.debug("{} Notify {}",policy.getBehavior(),incomingFramesHandler);
}
if (incomingFramesHandler == null)
{