def log_last_traceback(msg=None, log=logging.error):
 if (not log):
  log = logging.error
 if msg:
  log(msg)
 (exc_type, exc_value, exc_traceback) = sys.exc_info()
 if (not exc_traceback):
  log('Requested log_last_traceback but no exception was raised.')
  return
 log(('Original ' + ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))))

def log_last_traceback ( msg = None , log = logging . error ) : if ( not log ) : log = logging . error if msg : log ( msg ) ( exc_type , exc_value , exc_traceback ) = sys . exc_info ( ) if ( not exc_traceback ) : log ( 'Requested log_last_traceback but no exception was raised.' ) return log ( ( 'Original ' + '' . join ( traceback . format_exception ( exc_type , exc_value , exc_traceback ) ) ) )
writes last traceback into specified log .