From 4ef39ea43ccdf05b02a0d6733d8da328d249c242 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Sun, 18 Dec 2022 09:23:11 +0700 Subject: [PATCH] unify logs a bit (#6354) --- core/state/rw22.go | 2 +- eth/stagedsync/stage_hashstate.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/state/rw22.go b/core/state/rw22.go index 39e1a95b9..54735452d 100644 --- a/core/state/rw22.go +++ b/core/state/rw22.go @@ -113,7 +113,7 @@ func (rs *State22) Flush(ctx context.Context, rwTx kv.RwTx, logPrefix string, lo select { case <-logEvery.C: - log.Info(fmt.Sprintf("[%s] Flush", logPrefix), "table", table, "current_key", hex.EncodeToString([]byte(iter.Key()))) + log.Info(fmt.Sprintf("[%s] Flush", logPrefix), "table", table, "current_prefix", hex.EncodeToString([]byte(iter.Key())[:4])) case <-ctx.Done(): return ctx.Err() default: diff --git a/eth/stagedsync/stage_hashstate.go b/eth/stagedsync/stage_hashstate.go index 9fafca5d3..631375cc5 100644 --- a/eth/stagedsync/stage_hashstate.go +++ b/eth/stagedsync/stage_hashstate.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/binary" + "encoding/hex" "fmt" "runtime" "time" @@ -250,7 +251,7 @@ func promotePlainState( default: case <-logEvery.C: dbg.ReadMemStats(&m) - log.Info(fmt.Sprintf("[%s] ETL [1/2] Extracting", logPrefix), "current key", fmt.Sprintf("%x...", k[:6]), "alloc", libcommon.ByteCount(m.Alloc), "sys", libcommon.ByteCount(m.Sys)) + log.Info(fmt.Sprintf("[%s] ETL [1/2] Extracting", logPrefix), "current_prefix", hex.EncodeToString(k[:4]), "alloc", libcommon.ByteCount(m.Alloc), "sys", libcommon.ByteCount(m.Sys)) } }