'Process the log records'

def _processRecords(self):

    records = []
    try:
        while (not self.recordQueue.empty()):
            record = self.recordQueue.get(True, 1)
            if (record is None):
                break
            data = {}
            data['levelname'] = record.levelname
            data['msg'] = record.msg
            data['filename'] = record.filename
            data['threadName'] = record.threadName
            try:
                data['funcName'] = record.funcName
            except Exception:
                pass
            data['process'] = record.process
            data['lineno'] = record.lineno
            data['pymongoVersion'] = self.pymongoVersion
            data['pythonVersion'] = self.pythonVersion
            data['hostname'] = self.hostname
            records.append(data)
            if (len(records) >= 10):
                break
    except Queue.Empty:
        pass
    if (len(records) == 0):
        return
    res = None
    try:
        res = urllib2.urlopen(self.logUrl, bson.BSON.encode({'records': records}, check_keys=False))
        res.read()
    finally:
        if (res is not None):
            res.close()
