From 482699132af57eb6d7e4ac0cff398133ebcb78fb Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Sat, 15 Jun 2019 23:28:49 -0700 Subject: [PATCH] Shorten parameter names Old New ---------------- net n conn c stream s --- internal/utils/connlogger.go | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/utils/connlogger.go b/internal/utils/connlogger.go index 4be833a25..6e5b57fe6 100644 --- a/internal/utils/connlogger.go +++ b/internal/utils/connlogger.go @@ -16,43 +16,43 @@ type ConnLogger struct { l log.Logger } -func (cl ConnLogger) Listen(net net.Network, ma ma.Multiaddr) { - WithCaller(cl.l).Debug("listener starting", "net", net, "addr", ma) +func (cl ConnLogger) Listen(n net.Network, ma ma.Multiaddr) { + WithCaller(cl.l).Debug("listener starting", "net", n, "addr", ma) } -func (cl ConnLogger) ListenClose(net net.Network, ma ma.Multiaddr) { - WithCaller(cl.l).Debug("listener closing", "net", net, "addr", ma) +func (cl ConnLogger) ListenClose(n net.Network, ma ma.Multiaddr) { + WithCaller(cl.l).Debug("listener closing", "net", n, "addr", ma) } -func (cl ConnLogger) Connected(net net.Network, conn net.Conn) { - WithCaller(cl.l).Debug("connected", "net", net, - "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), - "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), +func (cl ConnLogger) Connected(n net.Network, c net.Conn) { + WithCaller(cl.l).Debug("connected", "net", n, + "localPeer", c.LocalPeer(), "localAddr", c.LocalMultiaddr(), + "remotePeer", c.RemotePeer(), "remoteAddr", c.RemoteMultiaddr(), ) } -func (cl ConnLogger) Disconnected(net net.Network, conn net.Conn) { - WithCaller(cl.l).Debug("disconnected", "net", net, - "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), - "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), +func (cl ConnLogger) Disconnected(n net.Network, c net.Conn) { + WithCaller(cl.l).Debug("disconnected", "net", n, + "localPeer", c.LocalPeer(), "localAddr", c.LocalMultiaddr(), + "remotePeer", c.RemotePeer(), "remoteAddr", c.RemoteMultiaddr(), ) } -func (cl ConnLogger) OpenedStream(net net.Network, stream net.Stream) { - conn := stream.Conn() - WithCaller(cl.l).Debug("stream opened", "net", net, +func (cl ConnLogger) OpenedStream(n net.Network, s net.Stream) { + conn := s.Conn() + WithCaller(cl.l).Debug("stream opened", "net", n, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), - "protocol", stream.Protocol(), + "protocol", s.Protocol(), ) } -func (cl ConnLogger) ClosedStream(net net.Network, stream net.Stream) { - conn := stream.Conn() - WithCaller(cl.l).Debug("stream closed", "net", net, +func (cl ConnLogger) ClosedStream(n net.Network, s net.Stream) { + conn := s.Conn() + WithCaller(cl.l).Debug("stream closed", "net", n, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), - "protocol", stream.Protocol(), + "protocol", s.Protocol(), ) }