def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def close(self):
        super(QueueingLogHandler, self).close()
        self._queue.put_nowait(None)