core/vm: Improved error reporting for trace logging

This commit is contained in:
obscuren
2015-06-12 13:35:14 +02:00
parent 02d629af8f
commit 287f990891
4 changed files with 49 additions and 50 deletions

View File

@ -9,9 +9,14 @@ import (
)
func StdErrFormat(logs []StructLog) {
fmt.Fprintf(os.Stderr, "VM Stats %d ops\n", len(logs))
fmt.Fprintf(os.Stderr, "VM STAT %d OPs\n", len(logs))
for _, log := range logs {
fmt.Fprintf(os.Stderr, "PC %08d: %s GAS: %v COST: %v\n", log.Pc, log.Op, log.Gas, log.GasCost)
fmt.Fprintf(os.Stderr, "PC %08d: %s GAS: %v COST: %v", log.Pc, log.Op, log.Gas, log.GasCost)
if log.Err != nil {
fmt.Fprintf(os.Stderr, " ERROR: %v", log.Err)
}
fmt.Fprintf(os.Stderr, "\n")
fmt.Fprintln(os.Stderr, "STACK =", len(log.Stack))
for i := len(log.Stack) - 1; i >= 0; i-- {