Skip to content

Commit

Permalink
chore: logging: switch runtime Print() spots to use the logger
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Jul 27, 2024
1 parent f234267 commit 940bf15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions chain/consensus/filcns/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
_ "embed"
"fmt"
"os"
"runtime"
"strconv"
Expand All @@ -13,7 +12,6 @@ import (
"github.com/docker/go-units"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"golang.org/x/term"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down Expand Up @@ -2521,9 +2519,7 @@ func UpgradeActorsV14(ctx context.Context, sm *stmgr.StateManager, cache stmgr.M
return cid.Undef, xerrors.Errorf("migrating actors v14 state: %w", err)
}

if term.IsTerminal(int(os.Stderr.Fd())) {
fmt.Print(upgradeSplash)
}
log.Info("\n\n" + upgradeSplash)

return newRoot, nil
}
Expand Down
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 940bf15

Please sign in to comment.