From 536d7c4275adebc60a5c500d8738634d8cfc80cb Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Fri, 21 May 2021 15:50:25 +0530 Subject: [PATCH] clean up logging --- extern/sector-storage/piece_provider.go | 2 +- extern/sector-storage/stores/remote.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/extern/sector-storage/piece_provider.go b/extern/sector-storage/piece_provider.go index 209989ae4..34ef44df5 100644 --- a/extern/sector-storage/piece_provider.go +++ b/extern/sector-storage/piece_provider.go @@ -81,7 +81,7 @@ func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef, r, unlock, err := p.tryReadUnsealedPiece(ctx, sector, offset, size) - log.Infof("tryReadUnsealedPiece result: r=%+v, err=%s", r, err) + log.Debugf("result of tryReadUnsealedPiece: r=%+v, err=%s", r, err) if xerrors.Is(err, storiface.ErrSectorNotFound) { log.Debugf("no unsealed sector file with unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size) diff --git a/extern/sector-storage/stores/remote.go b/extern/sector-storage/stores/remote.go index cd2848537..1bb6b041b 100644 --- a/extern/sector-storage/stores/remote.go +++ b/extern/sector-storage/stores/remote.go @@ -510,17 +510,16 @@ func (r *Remote) Reader(ctx context.Context, s storage.SectorRef, offset, size a log.Infof("Read local %s (+%d,%d)", path, offset, size) ssize, err := s.ProofType.SectorSize() if err != nil { - log.Debugf("failed to get sectorsize: %s", err) return nil, err } - log.Infof("fetched sector size %s (+%d,%d)", path, offset, size) + log.Debugf("fetched sector size %s (+%d,%d)", path, offset, size) // open the unsealed sector file for the given sector size located at the given path. pf, err := r.pfHandler.OpenPartialFile(abi.PaddedPieceSize(ssize), path) if err != nil { return nil, xerrors.Errorf("opening partial file: %w", err) } - log.Infof("partial file opened %s (+%d,%d)", path, offset, size) + log.Debugf("local partial file opened %s (+%d,%d)", path, offset, size) // even though we have an unsealed file for the given sector, we still need to determine if we have the unsealed piece // in the unsealed sector file. That is what `HasAllocated` checks for. @@ -528,10 +527,10 @@ func (r *Remote) Reader(ctx context.Context, s storage.SectorRef, offset, size a if err != nil { return nil, xerrors.Errorf("has allocated: %w", err) } - log.Infof("partial file is allocated %s (+%d,%d)", path, offset, size) + log.Debugf("check if partial file is allocated %s (+%d,%d)", path, offset, size) if !has { - log.Infof("miner has unsealed file but not unseal piece, %s (+%d,%d)", path, offset, size) + log.Debugf("miner has unsealed file but not unseal piece, %s (+%d,%d)", path, offset, size) if err := r.pfHandler.Close(pf); err != nil { return nil, xerrors.Errorf("close partial file: %w", err) }