mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 09:52:20 +08:00
silence verbose output
for higher SnR at IPFS_LOGGING=info License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
@ -31,7 +31,7 @@ const (
|
||||
// ReleaseBuffer puts the given byte array back into the buffer pool,
|
||||
// first verifying that it is the correct size
|
||||
func ReleaseBuffer(b []byte) {
|
||||
log.Warningf("Releasing buffer! (cap,size = %d, %d)", cap(b), len(b))
|
||||
log.Debugf("Releasing buffer! (cap,size = %d, %d)", cap(b), len(b))
|
||||
mpool.ByteSlicePool.Put(uint32(cap(b)), b)
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ func (c *MultiConn) Add(conns ...Conn) {
|
||||
defer c.Unlock()
|
||||
|
||||
for _, c2 := range conns {
|
||||
log.Infof("MultiConn: adding %s", c2)
|
||||
log.Debugf("MultiConn: adding %s", c2)
|
||||
if c.LocalPeer() != c2.LocalPeer() || c.RemotePeer() != c2.RemotePeer() {
|
||||
log.Error(c2)
|
||||
c.Unlock() // ok to unlock (to log). panicing.
|
||||
@ -86,7 +86,7 @@ func (c *MultiConn) Add(conns ...Conn) {
|
||||
c.Children().Add(1)
|
||||
c2.Children().Add(1) // yep, on the child too.
|
||||
go c.fanInSingle(c2)
|
||||
log.Infof("MultiConn: added %s", c2)
|
||||
log.Debugf("MultiConn: added %s", c2)
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ func (c *MultiConn) fanOut() {
|
||||
// send data out through our "best connection"
|
||||
case m, more := <-c.duplex.Out:
|
||||
if !more {
|
||||
log.Infof("%s out channel closed", c)
|
||||
log.Debugf("%s out channel closed", c)
|
||||
return
|
||||
}
|
||||
sc := c.BestConn()
|
||||
@ -159,7 +159,7 @@ func (c *MultiConn) fanOut() {
|
||||
}
|
||||
|
||||
i++
|
||||
log.Infof("%s sending (%d)", sc, i)
|
||||
log.Debugf("%s sending (%d)", sc, i)
|
||||
sc.Out() <- m
|
||||
}
|
||||
}
|
||||
@ -170,7 +170,7 @@ func (c *MultiConn) fanOut() {
|
||||
func (c *MultiConn) fanInSingle(child Conn) {
|
||||
// cleanup all data associated with this child Connection.
|
||||
defer func() {
|
||||
log.Infof("closing: %s", child)
|
||||
log.Debugf("closing: %s", child)
|
||||
|
||||
// in case it still is in the map, remove it.
|
||||
c.Lock()
|
||||
@ -197,7 +197,7 @@ func (c *MultiConn) fanInSingle(child Conn) {
|
||||
|
||||
case m, more := <-child.In(): // receiving data
|
||||
if !more {
|
||||
log.Infof("%s in channel closed", child)
|
||||
log.Debugf("%s in channel closed", child)
|
||||
err := c.GetError()
|
||||
if err != nil {
|
||||
log.Errorf("Found error on connection: %s", err)
|
||||
@ -205,7 +205,7 @@ func (c *MultiConn) fanInSingle(child Conn) {
|
||||
return // closed
|
||||
}
|
||||
i++
|
||||
log.Infof("%s received (%d)", child, i)
|
||||
log.Debugf("%s received (%d)", child, i)
|
||||
c.duplex.In <- m
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func resolveUnspecifiedAddresses(unspecifiedAddrs []ma.Multiaddr) ([]ma.Multiadd
|
||||
}
|
||||
return eventlog.Metadata{"addresses": addrs}
|
||||
}())
|
||||
log.Info("InterfaceListenAddresses:", outputAddrs)
|
||||
log.Debug("InterfaceListenAddresses:", outputAddrs)
|
||||
return outputAddrs, nil
|
||||
}
|
||||
|
||||
|
@ -274,10 +274,10 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.Peer, error)
|
||||
// Ping a peer, log the time it took
|
||||
func (dht *IpfsDHT) Ping(ctx context.Context, p peer.Peer) error {
|
||||
// Thoughts: maybe this should accept an ID and do a peer lookup?
|
||||
log.Infof("ping %s start", p)
|
||||
log.Debugf("ping %s start", p)
|
||||
|
||||
pmes := pb.NewMessage(pb.Message_PING, "", 0)
|
||||
_, err := dht.sendRequest(ctx, p, pmes)
|
||||
log.Infof("ping %s end (err = %s)", p, err)
|
||||
log.Debugf("ping %s end (err = %s)", p, err)
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user