def logs(self, things, follow, n, **kwargs):
        containers = self._to_containers(things)
        if len(containers) != 1:
            raise exceptions.ParameterException(
                'Logs can only be shown for a single container!')

        container = containers[0]

        o = termoutput.OutputFormatter()
        o.pending('Inspecting container status...')
        status = container.status()
        if not status:
            o.commit(termoutput.red('{} is not running!'.format(container)))
            return

        stream = follow and status['State']['Running']
        if stream:
            o.pending(
                'Now streaming logs for {}. New output will appear below.'
                .format(container.name))

            while True:
                logs = container.ship.backend.attach(container.id, stream=True)
                o.pending('\033[2K')
                for line in logs:
                    print(line.rstrip())

                o.pending('{} has died, waiting for respawn...'
                          .format(container.name))

                events = container.ship.backend.events(decode=True)
                for e in events:
                    if e['status'] == 'start':
                        spec = container.ship.backend.inspect_container(
                            e['id'])
                        if spec['Name'][1:] == container.name:
                            container.id = e['id']
                            break
        else:
            o.pending(
                'Requesting logs for {}. This may take a while...'
                .format(container.name))
            logs = container.ship.backend.logs(
                container.id, tail=n).decode('utf-8').splitlines()

            o.pending('\033[2K')
            for line in logs:
                print(line.rstrip())
Install packages with pip
dataset/ETHPy150Open signalfx/maestro-ng/maestro/maestro.py/Conductor.logs--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/pip.py/install