def StreamWithFilter(self, build_ref, backoff, output_filter=None):
    'Stream the logs for a build using whitelist filter.\n\n    Args:\n      build_ref: Build reference, The build whose logs shall be streamed.\n      backoff: A function that takes the current elapsed time\n        and returns the next sleep length. Both are in seconds.\n      output_filter: List of strings, The output will only be shown if the line\n        starts with one of the strings in the list.\n\n    Raises:\n      NoLogsBucketException: If the build does not specify a logsBucket.\n\n    Returns:\n      Build message, The completed or terminated build as read for the final\n      poll.\n    '
    build = self.GetBuild(build_ref)
    log_tailer = FilteredLogTailer.FromBuild(build)
    log_tailer.filter = output_filter
    statuses = self.messages.Build.StatusValueValuesEnum
    working_statuses = [statuses.QUEUED, statuses.WORKING]
    seconds_between_poll = backoff(0)
    seconds_elapsed = 0
    while (build.status in working_statuses):
        log_tailer.Poll()
        time.sleep(seconds_between_poll)
        build = self.GetBuild(build_ref)
        seconds_elapsed += seconds_between_poll
        seconds_between_poll = backoff(seconds_elapsed)
    log_tailer.Poll(is_last=True)
    return build
Stream the logs for a build using whitelist filter.

Args:
  build_ref: Build reference, The build whose logs shall be streamed.
  backoff: A function that takes the current elapsed time
    and returns the next sleep length. Both are in seconds.
  output_filter: List of strings, The output will only be shown if the line
    starts with one of the strings in the list.

Raises:
  NoLogsBucketException: If the build does not specify a logsBucket.

Returns:
  Build message, The completed or terminated build as read for the final
  poll.
def StreamWithFilter(self, build_ref, backoff, output_filter=None):
    'Stream the logs for a build using whitelist filter.\n\n    Args:\n      build_ref: Build reference, The build whose logs shall be streamed.\n      backoff: A function that takes the current elapsed time\n        and returns the next sleep length. Both are in seconds.\n      output_filter: List of strings, The output will only be shown if the line\n        starts with one of the strings in the list.\n\n    Raises:\n      NoLogsBucketException: If the build does not specify a logsBucket.\n\n    Returns:\n      Build message, The completed or terminated build as read for the final\n      poll.\n    '
    build = self.GetBuild(build_ref)
    log_tailer = FilteredLogTailer.FromBuild(build)
    log_tailer.filter = output_filter
    statuses = self.messages.Build.StatusValueValuesEnum
    working_statuses = [statuses.QUEUED, statuses.WORKING]
    seconds_between_poll = backoff(0)
    seconds_elapsed = 0
    while (build.status in working_statuses):
        log_tailer.Poll()
        time.sleep(seconds_between_poll)
        build = self.GetBuild(build_ref)
        seconds_elapsed += seconds_between_poll
        seconds_between_poll = backoff(seconds_elapsed)
    log_tailer.Poll(is_last=True)
    return build