mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 12:57:44 +08:00
Remove Notice{,f} logging interface
And substitute the lines using Notice{,f} with Info{,f}
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
parent
78b6cc5f2d
commit
4b086eff5a
@ -45,7 +45,7 @@ output of a running daemon.
|
||||
// TODO use a different keyword for 'all' because all can theoretically
|
||||
// clash with a subsystem name
|
||||
cmds.StringArg("subsystem", true, false, fmt.Sprintf("the subsystem logging identifier. Use '%s' for all subsystems.", logAllKeyword)),
|
||||
cmds.StringArg("level", true, false, "one of: debug, info, notice, warning, error, fatal"),
|
||||
cmds.StringArg("level", true, false, "one of: debug, info, warning, error, fatal"),
|
||||
},
|
||||
Run: func(req cmds.Request, res cmds.Response) {
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
|
||||
var keys []key.Key
|
||||
for _, block := range iblocks {
|
||||
if _, found := bs.wm.wl.Contains(block.Key()); !found {
|
||||
log.Notice("received un-asked-for block: %s", block)
|
||||
log.Info("received un-asked-for block: %s", block)
|
||||
continue
|
||||
}
|
||||
keys = append(keys, block.Key())
|
||||
@ -297,7 +297,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
|
||||
has, err := bs.blockstore.Has(b.Key())
|
||||
if err != nil {
|
||||
bs.counterLk.Unlock()
|
||||
log.Noticef("blockstore.Has error: %s", err)
|
||||
log.Infof("blockstore.Has error: %s", err)
|
||||
return
|
||||
}
|
||||
if err == nil && has {
|
||||
|
||||
@ -96,7 +96,7 @@ func (pm *WantManager) SendBlock(ctx context.Context, env *engine.Envelope) {
|
||||
log.Infof("Sending block %s to %s", env.Peer, env.Block)
|
||||
err := pm.network.SendMessage(ctx, env.Peer, msg)
|
||||
if err != nil {
|
||||
log.Noticef("sendblock error: %s", err)
|
||||
log.Infof("sendblock error: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ func (mq *msgQueue) doWork(ctx context.Context) {
|
||||
|
||||
err := mq.network.ConnectTo(conctx, mq.p)
|
||||
if err != nil {
|
||||
log.Noticef("cant connect to peer %s: %s", mq.p, err)
|
||||
log.Infof("cant connect to peer %s: %s", mq.p, err)
|
||||
// TODO: cant connect, what now?
|
||||
return
|
||||
}
|
||||
@ -174,7 +174,7 @@ func (mq *msgQueue) doWork(ctx context.Context) {
|
||||
// send wantlist updates
|
||||
err = mq.network.SendMessage(sendctx, mq.p, wlm)
|
||||
if err != nil {
|
||||
log.Noticef("bitswap send error: %s", err)
|
||||
log.Infof("bitswap send error: %s", err)
|
||||
// TODO: what do we do if this fails?
|
||||
return
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ func (fs *Filesystem) Close() error {
|
||||
defer wg.Done()
|
||||
err := r.Publish(context.TODO())
|
||||
if err != nil {
|
||||
log.Notice(err)
|
||||
log.Info(err)
|
||||
return
|
||||
}
|
||||
}(r)
|
||||
|
||||
@ -773,7 +773,7 @@ func TestConnectCollision(t *testing.T) {
|
||||
runTimes := 10
|
||||
|
||||
for rtime := 0; rtime < runTimes; rtime++ {
|
||||
log.Notice("Running Time: ", rtime)
|
||||
log.Info("Running Time: ", rtime)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
|
||||
2
thirdparty/eventlog/log.go
vendored
2
thirdparty/eventlog/log.go
vendored
@ -19,8 +19,6 @@ type StandardLogger interface {
|
||||
Fatalf(format string, args ...interface{})
|
||||
Info(args ...interface{})
|
||||
Infof(format string, args ...interface{})
|
||||
Notice(args ...interface{})
|
||||
Noticef(format string, args ...interface{})
|
||||
Panic(args ...interface{})
|
||||
Panicf(format string, args ...interface{})
|
||||
Warning(args ...interface{})
|
||||
|
||||
@ -210,7 +210,7 @@ func CliCheckForUpdates(cfg *config.Config, repoPath string) error {
|
||||
// if there is no update available, record it, and exit. NB: only record
|
||||
// if we checked successfully.
|
||||
if err == ErrNoUpdateAvailable {
|
||||
log.Noticef("No update available, checked on %s", time.Now())
|
||||
log.Infof("No update available, checked on %s", time.Now())
|
||||
r, err := fsrepo.Open(repoPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -238,7 +238,7 @@ func CliCheckForUpdates(cfg *config.Config, repoPath string) error {
|
||||
if cfg.Version.AutoUpdate != config.AutoUpdateNever {
|
||||
// and we should auto update
|
||||
if ShouldAutoUpdate(cfg.Version.AutoUpdate, u.Version) {
|
||||
log.Noticef("Applying update %s", u.Version)
|
||||
log.Infof("Applying update %s", u.Version)
|
||||
|
||||
if err = Apply(u); err != nil {
|
||||
log.Debug(err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user