Skip to content

Commit

Permalink
Refactor log information
Browse files Browse the repository at this point in the history
  • Loading branch information
suyanlong authored and vipwzw committed Aug 2, 2023
1 parent d784709 commit 9e284ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blockchain/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ func (bs *BlockStore) GetDbVersion() int64 {
return ver.Data
}

//SetDbVersion 获取blockchain的数据库版本号
//SetDbVersion 设置blockchain的数据库版本号
func (bs *BlockStore) SetDbVersion(versionNo int64) error {
ver := types.Int64{Data: versionNo}
verByte := types.Encode(&ver)
Expand Down
4 changes: 2 additions & 2 deletions executor/execenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func (e *executor) execTxOne(feelog *types.Receipt, tx *types.Transaction, index
e.startTx()
receipt, err := e.Exec(tx, index)
if err != nil {
elog.Error("exec tx error = ", "err", err, "exec", string(tx.Execer), "action", tx.ActionName())
elog.Error("execTxOne", "exec tx error", err, "exec", string(tx.Execer), "action", tx.ActionName())
//add error log
errlog := &types.ReceiptLog{Ty: types.TyLogErr, Log: []byte(err.Error())}
feelog.Logs = append(feelog.Logs, errlog)
Expand Down Expand Up @@ -632,7 +632,7 @@ func (e *executor) execTx(exec *Executor, tx *types.Transaction, index int) (*ty
feelog, err = e.execTxOne(feelog, tx, index)
if err != nil {
e.rollback()
elog.Error("exec tx = ", "index", index, "execer", string(tx.Execer), "err", err)
elog.Error("execTx", "index", index, "execer", string(tx.Execer), "err", err)
} else {
err := e.commit()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions util/cli/chain33.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ func createFile(filename string) (*os.File, error) {
func watching() {
var m runtime.MemStats
runtime.ReadMemStats(&m)
log.Info("info:", "NumGoroutine:", runtime.NumGoroutine())
log.Info("info:", "Mem:", m.Sys/(1024*1024))
log.Info("info:", "HeapAlloc:", m.HeapAlloc/(1024*1024))
log.Info("GC runtime info:", "NumGoroutine:", runtime.NumGoroutine())
log.Info("GC runtime info:", "Mem:", m.Sys/(1024*1024))
log.Info("GC runtime info:", "HeapAlloc:", m.HeapAlloc/(1024*1024))
}

func pwd() string {
Expand Down

0 comments on commit 9e284ed

Please sign in to comment.