30
30
VMError ,
31
31
)
32
32
from eth .tools .logging import (
33
- TraceLogger ,
33
+ ExtendedDebugLogger ,
34
34
)
35
35
from eth .utils .datatypes import (
36
36
Configurable ,
@@ -117,7 +117,7 @@ class BaseComputation(Configurable, ABC):
117
117
opcodes = None # type: Dict[int, Any]
118
118
_precompiles = None # type: Dict[Address, Callable[['BaseComputation'], 'BaseComputation']]
119
119
120
- logger = cast (TraceLogger , logging .getLogger ('eth.vm.computation.Computation' ))
120
+ logger = cast (ExtendedDebugLogger , logging .getLogger ('eth.vm.computation.Computation' ))
121
121
122
122
def __init__ (self ,
123
123
state : BaseState ,
@@ -214,7 +214,7 @@ def extend_memory(self, start_position: int, size: int) -> None:
214
214
before_cost = memory_gas_cost (before_size )
215
215
after_cost = memory_gas_cost (after_size )
216
216
217
- self .logger .trace (
217
+ self .logger .debug2 (
218
218
"MEMORY: size (%s -> %s) | cost (%s -> %s)" ,
219
219
before_size ,
220
220
after_size ,
@@ -472,7 +472,7 @@ def get_log_entries(self) -> Tuple[Tuple[bytes, List[int], bytes], ...]:
472
472
# Context Manager API
473
473
#
474
474
def __enter__ (self ) -> 'BaseComputation' :
475
- self .logger .trace (
475
+ self .logger .debug2 (
476
476
(
477
477
"COMPUTATION STARTING: gas: %s | from: %s | to: %s | value: %s "
478
478
"| depth %s | static: %s"
@@ -489,7 +489,7 @@ def __enter__(self) -> 'BaseComputation':
489
489
490
490
def __exit__ (self , exc_type : None , exc_value : None , traceback : None ) -> None :
491
491
if exc_value and isinstance (exc_value , VMError ):
492
- self .logger .trace (
492
+ self .logger .debug2 (
493
493
(
494
494
"COMPUTATION ERROR: gas: %s | from: %s | to: %s | value: %s | "
495
495
"depth: %s | static: %s | error: %s"
@@ -515,7 +515,7 @@ def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None:
515
515
# suppress VM exceptions
516
516
return True
517
517
elif exc_type is None :
518
- self .logger .trace (
518
+ self .logger .debug2 (
519
519
(
520
520
"COMPUTATION SUCCESS: from: %s | to: %s | value: %s | "
521
521
"depth: %s | static: %s | gas-used: %s | gas-remaining: %s"
@@ -563,7 +563,7 @@ def apply_computation(cls,
563
563
for opcode in computation .code :
564
564
opcode_fn = computation .get_opcode_fn (opcode )
565
565
566
- computation .logger .trace (
566
+ computation .logger .debug2 (
567
567
"OPCODE: 0x%x (%s) | pc: %s" ,
568
568
opcode ,
569
569
opcode_fn .mnemonic ,
0 commit comments