Skip to content

Commit 17972d4

Browse files
committed
Remove Notice{,f} logging interface
And substitute the lines using Notice{,f} with Info{,f}, except for exchange/bitswap/bitswap.go and exchange/bitswap/wantmanager.go where they are replaced with Warn{,f}. License: MIT Signed-off-by: rht <[email protected]>
1 parent f0e3e6d commit 17972d4

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

core/commands/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ output of a running daemon.
4545
// TODO use a different keyword for 'all' because all can theoretically
4646
// clash with a subsystem name
4747
cmds.StringArg("subsystem", true, false, fmt.Sprintf("the subsystem logging identifier. Use '%s' for all subsystems.", logAllKeyword)),
48-
cmds.StringArg("level", true, false, "one of: debug, info, notice, warning, error, fatal"),
48+
cmds.StringArg("level", true, false, "one of: debug, info, warning, error, fatal"),
4949
},
5050
Run: func(req cmds.Request, res cmds.Response) {
5151

exchange/bitswap/bitswap.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
280280
var keys []key.Key
281281
for _, block := range iblocks {
282282
if _, found := bs.wm.wl.Contains(block.Key()); !found {
283-
log.Notice("received un-asked-for block: %s", block)
283+
log.Info("received un-asked-for block: %s", block)
284284
continue
285285
}
286286
keys = append(keys, block.Key())
@@ -297,7 +297,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
297297
has, err := bs.blockstore.Has(b.Key())
298298
if err != nil {
299299
bs.counterLk.Unlock()
300-
log.Noticef("blockstore.Has error: %s", err)
300+
log.Infof("blockstore.Has error: %s", err)
301301
return
302302
}
303303
if err == nil && has {

exchange/bitswap/wantmanager.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (pm *WantManager) SendBlock(ctx context.Context, env *engine.Envelope) {
9696
log.Infof("Sending block %s to %s", env.Peer, env.Block)
9797
err := pm.network.SendMessage(ctx, env.Peer, msg)
9898
if err != nil {
99-
log.Noticef("sendblock error: %s", err)
99+
log.Warningf("sendblock error: %s", err)
100100
}
101101
}
102102

@@ -140,7 +140,7 @@ func (mq *msgQueue) runQueue(ctx context.Context) {
140140

141141
err := mq.network.ConnectTo(ctx, mq.p)
142142
if err != nil {
143-
log.Noticef("cant connect to peer %s: %s", mq.p, err)
143+
log.Warningf("cant connect to peer %s: %s", mq.p, err)
144144
// TODO: cant connect, what now?
145145
continue
146146
}
@@ -158,7 +158,7 @@ func (mq *msgQueue) runQueue(ctx context.Context) {
158158
// send wantlist updates
159159
err = mq.network.SendMessage(ctx, mq.p, wlm)
160160
if err != nil {
161-
log.Noticef("bitswap send error: %s", err)
161+
log.Warningf("bitswap send error: %s", err)
162162
// TODO: what do we do if this fails?
163163
}
164164
case <-mq.done:

ipnsfs/system.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (fs *Filesystem) Close() error {
8080
defer wg.Done()
8181
err := r.Publish(context.TODO())
8282
if err != nil {
83-
log.Notice(err)
83+
log.Warning(err)
8484
return
8585
}
8686
}(r)

routing/dht/dht_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ func TestConnectCollision(t *testing.T) {
773773
runTimes := 10
774774

775775
for rtime := 0; rtime < runTimes; rtime++ {
776-
log.Notice("Running Time: ", rtime)
776+
log.Info("Running Time: ", rtime)
777777

778778
ctx := context.Background()
779779

thirdparty/eventlog/log.go

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ type StandardLogger interface {
1919
Fatalf(format string, args ...interface{})
2020
Info(args ...interface{})
2121
Infof(format string, args ...interface{})
22-
Notice(args ...interface{})
23-
Noticef(format string, args ...interface{})
2422
Panic(args ...interface{})
2523
Panicf(format string, args ...interface{})
2624
Warning(args ...interface{})

updates/updates.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func CliCheckForUpdates(cfg *config.Config, repoPath string) error {
211211
// if there is no update available, record it, and exit. NB: only record
212212
// if we checked successfully.
213213
if err == ErrNoUpdateAvailable {
214-
log.Noticef("No update available, checked on %s", time.Now())
214+
log.Infof("No update available, checked on %s", time.Now())
215215
r, err := fsrepo.Open(repoPath)
216216
if err != nil {
217217
return err
@@ -239,7 +239,7 @@ func CliCheckForUpdates(cfg *config.Config, repoPath string) error {
239239
if cfg.Version.AutoUpdate != config.AutoUpdateNever {
240240
// and we should auto update
241241
if ShouldAutoUpdate(cfg.Version.AutoUpdate, u.Version) {
242-
log.Noticef("Applying update %s", u.Version)
242+
log.Infof("Applying update %s", u.Version)
243243

244244
if err = Apply(u); err != nil {
245245
log.Debug(err)

0 commit comments

Comments
 (0)