def test_how_to_use_as_vm_logger():
 slogging.configure(':DEBUG,eth.vm:INFO')
 log = slogging.get_logger('eth.vm')
 def run_vm(raise_error=False):
  log.trace('op', pc=1)
  log.trace('op', pc=2)
  if raise_error:
   raise Exception
 recorder = slogging.LogRecorder()
 try:
  run_vm(raise_error=True)
 except:
  log = slogging.get_logger('eth.vm')
  for x in recorder.pop_records():
   log.info(x.pop('event'), **x)

def test_how_to_use_as_vm_logger ( ) : slogging . configure ( ':DEBUG,eth.vm:INFO' ) log = slogging . get_logger ( 'eth.vm' ) def run_vm ( raise_error = False ) : log . trace ( 'op' , pc = 1 ) log . trace ( 'op' , pc = 2 ) if raise_error : raise Exception recorder = slogging . LogRecorder ( ) try : run_vm ( raise_error = True ) except : log = slogging . get_logger ( 'eth.vm' ) for x in recorder . pop_records ( ) : log . info ( x . pop ( 'event' ) , ** x )
dont log until there was an error .