Commit ae0386cf authored by Juan Batiz-Benet's avatar Juan Batiz-Benet
Browse files

user friendliness in logs + output

parent 44fe2f07
......@@ -293,7 +293,7 @@ func (s *Swarm) dial(ctx context.Context, p peer.ID) (*Conn, error) {
// ok try to setup the new connection.
swarmC, err := dialConnSetup(ctx, s, connC)
if err != nil {
log.Error("Dial newConnSetup failed. disconnecting.")
log.Debug("Dial newConnSetup failed. disconnecting.")
log.Event(ctx, "dialFailureDisconnect", lgbl.NetConn(connC), lgbl.Error(err))
connC.Close() // close the connection. didn't work out :(
return nil, err
......@@ -398,7 +398,7 @@ func dialConnSetup(ctx context.Context, s *Swarm, connC conn.Conn) (*Conn, error
// ok try to setup the new connection. (newConnSetup will add to group)
swarmC, err := s.newConnSetup(ctx, psC)
if err != nil {
log.Error("Dial newConnSetup failed. disconnecting.")
log.Debug("Dial newConnSetup failed. disconnecting.")
log.Event(ctx, "dialFailureDisconnect", lgbl.NetConn(connC), lgbl.Error(err))
psC.Close() // we need to make sure psC is Closed.
return nil, err
......
......@@ -79,7 +79,7 @@ func (ids *IDService) IdentifyConn(c inet.Conn) {
// ok give the response to our handler.
if err := protocol.WriteHeader(s, ID); err != nil {
log.Error("error writing stream header for %s", ID)
log.Debugf("error writing stream header for %s", ID)
log.Event(context.TODO(), "IdentifyOpenFailed", c.RemotePeer())
}
ids.ResponseHandler(s)
......@@ -118,7 +118,7 @@ func (ids *IDService) ResponseHandler(s inet.Stream) {
r := ggio.NewDelimitedReader(s, 2048)
mes := pb.Identify{}
if err := r.ReadMsg(&mes); err != nil {
log.Errorf("%s error receiving message from %s %s %s", ID,
log.Debugf("%s error receiving message from %s %s %s", ID,
c.RemotePeer(), c.RemoteMultiaddr(), err)
return
}
......@@ -169,7 +169,7 @@ func (ids *IDService) consumeMessage(mes *pb.Identify, c inet.Conn) {
for _, addr := range laddrs {
maddr, err := ma.NewMultiaddrBytes(addr)
if err != nil {
log.Errorf("%s failed to parse multiaddr from %s %s", ID,
log.Debugf("%s failed to parse multiaddr from %s %s", ID,
p, c.RemoteMultiaddr())
continue
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment