1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

logs: removed all log.Errors unhelpful to users

Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
This commit is contained in:
Juan Batiz-Benet
2015-02-03 01:06:07 -08:00
parent 61c97f80a3
commit 58f39687cf
29 changed files with 81 additions and 117 deletions

View File

@ -43,19 +43,16 @@ func (p *ipnsPublisher) Publish(ctx context.Context, k ci.PrivKey, value u.Key)
// validate `value` is a ref (multihash)
_, err := mh.FromB58String(value.Pretty())
if err != nil {
log.Errorf("hash cast failed: %s", value)
return fmt.Errorf("publish value must be str multihash. %v", err)
}
data, err := createRoutingEntryData(k, value)
if err != nil {
log.Error("entry creation failed.")
return err
}
pubkey := k.GetPublic()
pkbytes, err := pubkey.Bytes()
if err != nil {
log.Error("pubkey getbytes failed.")
return err
}
@ -120,7 +117,7 @@ func ValidateIpnsRecord(k u.Key, val []byte) error {
case pb.IpnsEntry_EOL:
t, err := u.ParseRFC3339(string(entry.GetValidity()))
if err != nil {
log.Error("Failed parsing time for ipns record EOL")
log.Debug("Failed parsing time for ipns record EOL")
return err
}
if time.Now().After(t) {