def formatEventAsClassicLogText(event, formatTime=formatTime):
 eventText = formatEvent(event)
 if ('log_failure' in event):
  try:
   traceback = event['log_failure'].getTraceback()
  except:
   traceback = u'(UNABLE TO OBTAIN TRACEBACK FROM EVENT)\n'
  eventText = u'\n'.join((eventText, traceback))
 if (not eventText):
  return None
 eventText = eventText.replace(u'\n', u'\n DCTB ')
 timeStamp = formatTime(event.get('log_time', None))
 system = event.get('log_system', None)
 if (system is None):
  level = event.get('log_level', None)
  if (level is None):
   levelName = u'-'
  else:
   levelName = level.name
  system = u'{namespace}#{level}'.format(namespace=event.get('log_namespace', u'-'), level=levelName)
 else:
  try:
   system = unicode(system)
  except Exception:
   system = u'UNFORMATTABLE'
 return u'{timeStamp} [{system}] {event}\n'.format(timeStamp=timeStamp, system=system, event=eventText)

def formatEventAsClassicLogText ( event , formatTime = formatTime ) : eventText = formatEvent ( event ) if ( 'log_failure' in event ) : try : traceback = event [ 'log_failure' ] . getTraceback ( ) except : traceback = u'(UNABLE TO OBTAIN TRACEBACK FROM EVENT)\n' eventText = u'\n' . join ( ( eventText , traceback ) ) if ( not eventText ) : return None eventText = eventText . replace ( u'\n' , u'\n DCTB ' ) timeStamp = formatTime ( event . get ( 'log_time' , None ) ) system = event . get ( 'log_system' , None ) if ( system is None ) : level = event . get ( 'log_level' , None ) if ( level is None ) : levelName = u'-' else : levelName = level . name system = u'{namespace}#{level}' . format ( namespace = event . get ( 'log_namespace' , u'-' ) , level = levelName ) else : try : system = unicode ( system ) except Exception : system = u'UNFORMATTABLE' return u'{timeStamp} [{system}] {event}\n' . format ( timeStamp = timeStamp , system = system , event = eventText )
format an event as a line of human-readable text for .