unify logs a bit (#6354)

This commit is contained in:
Alex Sharov 2022-12-18 09:23:11 +07:00 committed by GitHub
parent d4623ec9d7
commit 4ef39ea43c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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))
}
}