'Log an Event object.'

def log_event(self, event):

    with self._lock:
        self._save_events([event])
        self._logged += 1
        self._maybe_rotate_log()
        self._notify_waiters()
        for ui in self._watching_uis:
            ui.notify(event.as_text(compact=True))
    return event
