def scribe_tail(self, scribe_env, stream_name, service, levels, components, clusters, queue, filter_fn,
                    parse_fn=None):
        """Creates a scribetailer for a particular environment.

        When it encounters a line that it should report, it sticks it into the
        provided queue.

        This code is designed to run in a thread as spawned by tail_paasta_logs().
        """
        try:
            log.debug("Going to tail %s scribe stream in %s" % (stream_name, scribe_env))
            host_and_port = scribereader.get_env_scribe_host(scribe_env, True)
            host = host_and_port['host']
            port = host_and_port['port']
            tailer = scribereader.get_stream_tailer(stream_name, host, port)
            for line in tailer:
                if parse_fn:
                    line = parse_fn(line, clusters, service)
                if filter_fn(line, levels, service, components, clusters):
                    queue.put(line)
        except __HOLE__:
            # Die peacefully rather than printing N threads worth of stack
            # traces.
            pass
        except StreamTailerSetupError:
            log.error("Failed to setup stream tailing for %s in %s" % (stream_name, scribe_env))
            log.error("Don't Panic! This can happen the first time a service is deployed because the log")
            log.error("doesn't exist yet. Please wait for the service to be deployed in %s and try again." % scribe_env)
            raise
dataset/ETHPy150Open Yelp/paasta/paasta_tools/cli/cmds/logs.py/ScribeLogReader.scribe_tail