def log_trace(errmsg=None):
 tracestring = format_exc()
 try:
  if tracestring:
   for line in tracestring.splitlines():
    log.msg(('[::] %s' % line))
  if errmsg:
   try:
    errmsg = str(errmsg)
   except Exception as e:
    errmsg = str(e)
   for line in errmsg.splitlines():
    log.msg(('[EE] %s' % line))
 except Exception:
  log.msg(('[EE] %s' % errmsg))

def log_trace ( errmsg = None ) : tracestring = format_exc ( ) try : if tracestring : for line in tracestring . splitlines ( ) : log . msg ( ( '[::] %s' % line ) ) if errmsg : try : errmsg = str ( errmsg ) except Exception as e : errmsg = str ( e ) for line in errmsg . splitlines ( ) : log . msg ( ( '[EE] %s' % line ) ) except Exception : log . msg ( ( '[EE] %s' % errmsg ) )
log a traceback to the log .