'parse the input args/kwargs into a record dict according to format string
- timestamps are formatted to date/time strings
- fields not in the input will be defined but blank
- extra fields in the record will be formatted into a
"name=value name2=value2..." string and put in \'extra\'
- args will go into \'data\'
- format keyword can contain a new format string to use (this also sets format for future output)'

def parse(self, *args, **kw):

    for ts in [k for k in kw if ((k == 'ts') or k.endswith('time'))]:
        dt = (ts[:(-4)] + 'datetime')
        kw[dt] = datetime.datetime.fromtimestamp(float(kw[ts])).strftime(self.timeformat)
    if (kw.get('direction') is 'cs'):
        kw['dir_arrow'] = '->'
    elif (kw.get('direction') is 'sc'):
        kw['dir_arrow'] = '<-'
    else:
        kw['dir_arrow'] = '--'
    if ('format' in kw):
        self.setformat(kw['format'])
        del kw['format']
    rec = dict(((f, self._NULL) for f in self.fieldnames))
    if self._FILTER_EXTRA:
        rec.update(dict(((f, kw[f]) for f in self.fieldnames if ((f in kw) and (kw[f] != None)))))
        if self.extra:
            rec['extra'] = self.delim.join([('%s=%s' % (f, kw[f])) for f in sorted(kw.keys()) if ((f not in self.fieldnames) and (f != 'addr'))])
    else:
        rec.update(kw)
    if args:
        rec['data'] = self.delim.join(map(str, args))
    return rec
