Improved toString().

This commit is contained in:
Simone Bordet 2015-12-15 14:11:56 +01:00
parent bf9f39dc17
commit d4d9ceea86
2 changed files with 19 additions and 2 deletions

View File

@ -989,8 +989,16 @@ public abstract class HTTP2Session implements ISession, Parser.Listener
@Override
public String toString()
{
return String.format("%s@%x{queueSize=%d,sendWindow=%s,recvWindow=%s,streams=%d,%s}", getClass().getSimpleName(),
hashCode(), flusher.getQueueSize(), sendWindow, recvWindow, streams.size(), closed);
return String.format("%s@%x{l:%s <-> r:%s,queueSize=%d,sendWindow=%s,recvWindow=%s,streams=%d,%s}",
getClass().getSimpleName(),
hashCode(),
getEndPoint().getLocalAddress(),
getEndPoint().getRemoteAddress(),
flusher.getQueueSize(),
sendWindow,
recvWindow,
streams.size(),
closed);
}
private class ControlEntry extends HTTP2Flusher.Entry

View File

@ -85,4 +85,13 @@ public class HttpConnectionOverHTTP2 extends HttpConnection
}
channels.clear();
}
@Override
public String toString()
{
return String.format("%s@%h[%s]",
getClass().getSimpleName(),
this,
session);
}
}