Skip to content

Commit

Permalink
chore: logging: switch stdout print to use the logger (#12311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Aug 17, 2024
1 parent f33b180 commit 355dd8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions node/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package bundle
import (
"bytes"
"context"
"fmt"
"io"
"os"

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/ipld/go-car"
"golang.org/x/xerrors"

Expand All @@ -19,6 +19,8 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
)

var log = logging.Logger("bundle")

func LoadBundleFromFile(ctx context.Context, bs blockstore.Blockstore, path string) (cid.Cid, error) {
f, err := os.Open(path)
if err != nil {
Expand Down Expand Up @@ -55,7 +57,7 @@ func LoadBundles(ctx context.Context, bs blockstore.Blockstore, versions ...acto
// All manifests are registered on start, so this must succeed.
return xerrors.Errorf("unknown actor version v%d", av)
}
fmt.Printf("manifest cid: %s\n", manifestCid)
log.Infof("manifest cid: %s", manifestCid)

if haveManifest, err := bs.Has(ctx, manifestCid); err != nil {
return xerrors.Errorf("blockstore error when loading manifest %s: %w", manifestCid, err)
Expand Down

0 comments on commit 355dd8d

Please sign in to comment.