Improved logging.

This commit is contained in:
Simone Bordet 2012-01-27 21:28:43 +01:00
parent 3e3f9f181b
commit 6d0bcc6a54
1 changed files with 11 additions and 5 deletions

View File

@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory;
public class AsyncSPDYConnection extends AbstractConnection implements AsyncConnection, Controller { public class AsyncSPDYConnection extends AbstractConnection implements AsyncConnection, Controller {
protected static final Logger logger = LoggerFactory.getLogger(AsyncSPDYConnection.class); private static final Logger logger = LoggerFactory.getLogger(AsyncSPDYConnection.class);
private final Parser parser; private final Parser parser;
private ByteBuffer buffer; private ByteBuffer buffer;
private Handler handler; private Handler handler;
@ -44,9 +44,11 @@ public class AsyncSPDYConnection extends AbstractConnection implements AsyncConn
int filled = fill(); int filled = fill();
progress |= filled > 0; progress |= filled > 0;
logger.debug("Filled {} from {}", filled, endPoint);
int flushed = flush(); int flushed = flush();
progress |= flushed > 0; progress |= flushed > 0;
logger.debug("Flushed {} to {}", flushed, endPoint);
endPoint.flush(); endPoint.flush();
@ -90,7 +92,8 @@ public class AsyncSPDYConnection extends AbstractConnection implements AsyncConn
AsyncEndPoint endPoint = getEndPoint(); AsyncEndPoint endPoint = getEndPoint();
try try
{ {
endPoint.flush(jettyBuffer); int written = endPoint.flush(jettyBuffer);
logger.debug("Written {} bytes", written);
} }
catch (IOException x) catch (IOException x)
{ {
@ -132,20 +135,23 @@ public class AsyncSPDYConnection extends AbstractConnection implements AsyncConn
{ {
try try
{ {
AsyncEndPoint endPoint = getEndPoint();
if (onlyOutput) if (onlyOutput)
{ {
try try
{ {
getEndPoint().shutdownOutput(); logger.debug("Shutting down output {}", endPoint);
endPoint.shutdownOutput();
} }
catch (IOException x) catch (IOException x)
{ {
getEndPoint().close(); endPoint.close();
} }
} }
else else
{ {
getEndPoint().close(); logger.debug("Closing {}", endPoint);
endPoint.close();
} }
} }
catch (IOException x) catch (IOException x)