Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix log format #4984

Merged
merged 2 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chain/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (e *Events) listenHeadChangesOnce(ctx context.Context) error {
}

if err := e.tsc.add(cur[0].Val); err != nil {
log.Warn("tsc.add: adding current tipset failed: %w", err)
log.Warnf("tsc.add: adding current tipset failed: %v", err)
}

e.readyOnce.Do(func() {
Expand Down
2 changes: 1 addition & 1 deletion chain/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ loop:
continue
}
if !xerrors.Is(err, bstore.ErrNotFound) {
log.Warn("loading local tipset: %s", err)
log.Warnf("loading local tipset: %s", err)
}

// NB: GetBlocks validates that the blocks are in-fact the ones we
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-fountain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var runCmd = &cli.Command{
return err
}

log.Info("Remote version: %s", v.Version)
log.Infof("Remote version: %s", v.Version)

from, err := address.NewFromString(cctx.String("from"))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func importKey(ctx context.Context, api api.FullNode, f string) error {
return err
}

log.Info("successfully imported key for %s", addr)
log.Infof("successfully imported key for %s", addr)
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions extern/sector-storage/manager_calltracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ func (m *Manager) getWork(ctx context.Context, method sealtasks.TaskType, params

switch ws.Status {
case wsStarted:
log.Warn("canceling started (not running) work %s", wid)
log.Warnf("canceling started (not running) work %s", wid)

if err := m.work.Get(wid).End(); err != nil {
log.Errorf("cancel: failed to cancel started work %s: %+v", wid, err)
return
}
case wsDone:
// TODO: still remove?
log.Warn("cancel called on work %s in 'done' state", wid)
log.Warnf("cancel called on work %s in 'done' state", wid)
case wsRunning:
log.Warn("cancel called on work %s in 'running' state (manager shutting down?)", wid)
log.Warnf("cancel called on work %s in 'running' state (manager shutting down?)", wid)
}

}, nil
Expand Down
2 changes: 1 addition & 1 deletion extern/sector-storage/sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (sh *scheduler) trySched() {

r, err := task.sel.Cmp(rpcCtx, task.taskType, wi, wj)
if err != nil {
log.Error("selecting best worker: %s", err)
log.Errorf("selecting best worker: %s", err)
}
return r
})
Expand Down
2 changes: 1 addition & 1 deletion extern/sector-storage/sched_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ assignLoop:
err := sw.startProcessingTask(sw.taskDone, todo)

if err != nil {
log.Error("startProcessingTask error: %+v", err)
log.Errorf("startProcessingTask error: %+v", err)
go todo.respond(xerrors.Errorf("startProcessingTask error: %w", err))
}

Expand Down
2 changes: 1 addition & 1 deletion extern/storage-sealing/sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (m *Sealing) newDealSector(ctx context.Context) (abi.SectorNumber, abi.Sect

m.unsealedInfoMap.lk.Unlock()
if err := m.StartPacking(best); err != nil {
log.Error("newDealSector StartPacking error: %+v", err)
log.Errorf("newDealSector StartPacking error: %+v", err)
continue // let's pretend this is fine
}
m.unsealedInfoMap.lk.Lock()
Expand Down
6 changes: 3 additions & 3 deletions extern/storage-sealing/states_failed.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ func (m *Sealing) handlePreCommitFailed(ctx statemachine.Context, sector SectorI

if pci, is := m.checkPreCommitted(ctx, sector); is && pci != nil {
if sector.PreCommitMessage == nil {
log.Warn("sector %d is precommitted on chain, but we don't have precommit message", sector.SectorNumber)
log.Warnf("sector %d is precommitted on chain, but we don't have precommit message", sector.SectorNumber)
return ctx.Send(SectorPreCommitLanded{TipSet: tok})
}

if pci.Info.SealedCID != *sector.CommR {
log.Warn("sector %d is precommitted on chain, with different CommR: %x != %x", sector.SectorNumber, pci.Info.SealedCID, sector.CommR)
log.Warnf("sector %d is precommitted on chain, with different CommR: %x != %x", sector.SectorNumber, pci.Info.SealedCID, sector.CommR)
return nil // TODO: remove when the actor allows re-precommit
}

Expand Down Expand Up @@ -387,7 +387,7 @@ func (m *Sealing) handleRecoverDealIDs(ctx statemachine.Context, sector SectorIn

if p.DealInfo.PublishCid == nil {
// TODO: check if we are in an early enough state try to remove this piece
log.Error("can't fix sector deals: piece %d (of %d) of sector %d has nil DealInfo.PublishCid (refers to deal %d)", i, len(sector.Pieces), sector.SectorNumber, p.DealInfo.DealID)
log.Errorf("can't fix sector deals: piece %d (of %d) of sector %d has nil DealInfo.PublishCid (refers to deal %d)", i, len(sector.Pieces), sector.SectorNumber, p.DealInfo.DealID)
// Not much to do here (and this can only happen for old spacerace sectors)
return ctx.Send(SectorRemove{})
}
Expand Down
4 changes: 2 additions & 2 deletions lib/rpcenc/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ func ReaderParamDecoder() (http.HandlerFunc, jsonrpc.ServerOption) {
case ch <- wr:
case <-tctx.Done():
close(ch)
log.Error("context error in reader stream handler (1): %v", tctx.Err())
log.Errorf("context error in reader stream handler (1): %v", tctx.Err())
resp.WriteHeader(500)
return
}

select {
case <-wr.wait:
case <-req.Context().Done():
log.Error("context error in reader stream handler (2): %v", req.Context().Err())
log.Errorf("context error in reader stream handler (2): %v", req.Context().Err())
resp.WriteHeader(500)
return
}
Expand Down