user friendliness in logs + output

This commit is contained in:
Juan Batiz-Benet 2015-01-24 16:22:14 -08:00
parent 44fe2f0709
commit ae0386cfba
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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
}