diff --git a/CHANGELOG.md b/CHANGELOG.md index 53703300b3..8a370f1ac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - [#1302](https://github.com/crypto-org-chain/cronos/pull/1302) Fix concurrent map access in rootmulti store. - [#1304](https://github.com/crypto-org-chain/cronos/pull/1304) Write versiondb with fsync, and relax the version requirement on startup. - [#1308](https://github.com/crypto-org-chain/cronos/pull/1308) Update ethermint to fix duplicate cache events emitted from evm hooks and wrong priority tx. +- [#1311](https://github.com/crypto-org-chain/cronos/pull/1311) Add missing version in memiavl log. ### Improvements diff --git a/memiavl/db.go b/memiavl/db.go index 2ba16959ee..c9541ac928 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -204,14 +204,14 @@ func Load(dir string, opts Options) (*DB, error) { if snapshot != currentSnapshot { // downgrade `"current"` link first - opts.Logger.Info("downgrade current link to %s", snapshot) + opts.Logger.Info("downgrade current link to", "snapshot", snapshot) if err := updateCurrentSymlink(dir, snapshot); err != nil { return nil, fmt.Errorf("fail to update current snapshot link: %w", err) } } // truncate the WAL - opts.Logger.Info("truncate WAL from back, version: %d", opts.TargetVersion) + opts.Logger.Info("truncate WAL from back", "version", opts.TargetVersion) if err := wal.TruncateBack(walIndex(int64(opts.TargetVersion), mtree.initialVersion)); err != nil { return nil, fmt.Errorf("fail to truncate wal logs: %w", err) } @@ -223,9 +223,9 @@ func Load(dir string, opts Options) (*DB, error) { } if err := atomicRemoveDir(filepath.Join(dir, snapshotName(version))); err != nil { - opts.Logger.Error("fail to prune snapshot, version: %d", version) + opts.Logger.Error("fail to prune snapshot", "version", version, "err", err) } else { - opts.Logger.Info("prune snapshot, version: %d", version) + opts.Logger.Info("prune snapshot", "version", version) } return false, nil }); err != nil {