mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
evm cli: no logs if --json (#8925)
This commit is contained in:
parent
4696769d25
commit
e006db6ed9
@ -119,10 +119,12 @@ func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) (output []by
|
||||
}
|
||||
|
||||
func runCmd(ctx *cli.Context) error {
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StderrHandler))
|
||||
//glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
|
||||
//glogger.Verbosity(log.Lvl(ctx.GlobalInt(VerbosityFlag.Name)))
|
||||
//log.Root().SetHandler(glogger)
|
||||
machineFriendlyOutput := ctx.Bool(MachineFlag.Name)
|
||||
if machineFriendlyOutput {
|
||||
log.Root().SetHandler(log.DiscardHandler())
|
||||
} else {
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StderrHandler))
|
||||
}
|
||||
logconfig := &logger.LogConfig{
|
||||
DisableMemory: ctx.Bool(DisableMemoryFlag.Name),
|
||||
DisableStack: ctx.Bool(DisableStackFlag.Name),
|
||||
@ -140,7 +142,7 @@ func runCmd(ctx *cli.Context) error {
|
||||
receiver = libcommon.BytesToAddress([]byte("receiver"))
|
||||
genesisConfig *types.Genesis
|
||||
)
|
||||
if ctx.Bool(MachineFlag.Name) {
|
||||
if machineFriendlyOutput {
|
||||
tracer = logger.NewJSONLogger(logconfig, os.Stdout)
|
||||
} else if ctx.Bool(DebugFlag.Name) {
|
||||
debugLogger = logger.NewStructLogger(logconfig)
|
||||
|
@ -57,8 +57,12 @@ type StatetestResult struct {
|
||||
}
|
||||
|
||||
func stateTestCmd(ctx *cli.Context) error {
|
||||
// Configure the go-ethereum logger
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlDebug, log.StderrHandler))
|
||||
machineFriendlyOutput := ctx.Bool(MachineFlag.Name)
|
||||
if machineFriendlyOutput {
|
||||
log.Root().SetHandler(log.DiscardHandler())
|
||||
} else {
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StderrHandler))
|
||||
}
|
||||
|
||||
// Configure the EVM logger
|
||||
config := &logger.LogConfig{
|
||||
@ -70,7 +74,7 @@ func stateTestCmd(ctx *cli.Context) error {
|
||||
cfg := vm.Config{
|
||||
Debug: ctx.Bool(DebugFlag.Name) || ctx.Bool(MachineFlag.Name),
|
||||
}
|
||||
if ctx.Bool(MachineFlag.Name) {
|
||||
if machineFriendlyOutput {
|
||||
cfg.Tracer = logger.NewJSONLogger(config, os.Stderr)
|
||||
} else if ctx.Bool(DebugFlag.Name) {
|
||||
cfg.Tracer = logger.NewStructLogger(config)
|
||||
|
Loading…
Reference in New Issue
Block a user