code: def clear(self):
          
          self._lock.acquire()
          try:
              self._cache = []
              self._updated = False
          finally:
              self._lock.release()
docs: Clears (removes) all cached log messages.