From 9bff04a612050952603b71c88c8c352e8fc082ac Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Sat, 15 Jun 2019 23:06:13 -0700 Subject: [PATCH] Replace message prefix with function logging --- internal/utils/connlogger.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/utils/connlogger.go b/internal/utils/connlogger.go index 21c99dc31..4be833a25 100644 --- a/internal/utils/connlogger.go +++ b/internal/utils/connlogger.go @@ -17,22 +17,22 @@ type ConnLogger struct { } func (cl ConnLogger) Listen(net net.Network, ma ma.Multiaddr) { - cl.l.Debug("[CONNECTIONS] Listener starting", "net", net, "addr", ma) + WithCaller(cl.l).Debug("listener starting", "net", net, "addr", ma) } func (cl ConnLogger) ListenClose(net net.Network, ma ma.Multiaddr) { - cl.l.Debug("[CONNECTIONS] Listener closing", "net", net, "addr", ma) + WithCaller(cl.l).Debug("listener closing", "net", net, "addr", ma) } func (cl ConnLogger) Connected(net net.Network, conn net.Conn) { - cl.l.Debug("[CONNECTIONS] Connected", "net", net, + WithCaller(cl.l).Debug("connected", "net", net, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), ) } func (cl ConnLogger) Disconnected(net net.Network, conn net.Conn) { - cl.l.Debug("[CONNECTIONS] Disconnected", "net", net, + WithCaller(cl.l).Debug("disconnected", "net", net, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), ) @@ -40,7 +40,7 @@ func (cl ConnLogger) Disconnected(net net.Network, conn net.Conn) { func (cl ConnLogger) OpenedStream(net net.Network, stream net.Stream) { conn := stream.Conn() - cl.l.Debug("[CONNECTIONS] Stream opened", "net", net, + WithCaller(cl.l).Debug("stream opened", "net", net, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), "protocol", stream.Protocol(), @@ -49,7 +49,7 @@ func (cl ConnLogger) OpenedStream(net net.Network, stream net.Stream) { func (cl ConnLogger) ClosedStream(net net.Network, stream net.Stream) { conn := stream.Conn() - cl.l.Debug("[CONNECTIONS] Stream closed", "net", net, + WithCaller(cl.l).Debug("stream closed", "net", net, "localPeer", conn.LocalPeer(), "localAddr", conn.LocalMultiaddr(), "remotePeer", conn.RemotePeer(), "remoteAddr", conn.RemoteMultiaddr(), "protocol", stream.Protocol(),