def flatFormat(event):
 fieldValues = event['log_flattened']
 s = []
 keyFlattener = KeyFlattener()
 formatFields = aFormatter.parse(event['log_format'])
 for (literalText, fieldName, formatSpec, conversion) in formatFields:
  s.append(literalText)
  if (fieldName is not None):
   key = keyFlattener.flatKey(fieldName, formatSpec, (conversion or 's'))
   s.append(unicode(fieldValues[key]))
 return u''.join(s)

def flatFormat ( event ) : fieldValues = event [ 'log_flattened' ] s = [ ] keyFlattener = KeyFlattener ( ) formatFields = aFormatter . parse ( event [ 'log_format' ] ) for ( literalText , fieldName , formatSpec , conversion ) in formatFields : s . append ( literalText ) if ( fieldName is not None ) : key = keyFlattener . flatKey ( fieldName , formatSpec , ( conversion or 's' ) ) s . append ( unicode ( fieldValues [ key ] ) ) return u'' . join ( s )
format an event which has been flattened with l{flattenevent} .