code: func swarmingFetchMaybeLogs(c context.Context, svc SwarmingService, taskID string) (
  	*swarmingFetchResult, *types.StreamAddr, error) {
  	// Fetch the data from Swarming
  	var logDogStreamAddr *types.StreamAddr
  
  	fetchParams := swarmingFetchParams{
  		fetchLog: true,
  
  		// Cancel if LogDog annotation stream parameters are present in the tag set.
  		taskResCallback: func(res *swarming.SwarmingRpcsTaskResult) (cancelLogs bool) {
  			// If the build hasn't started yet, then there is no LogDog log stream to
  			// render.
  			switch res.State {
  			case TaskPending, TaskExpired:
  				return false
  
  			case TaskCanceled, TaskKilled:
  				// If the task wasn't created, then it wasn't started.
  				if res.CreatedTs == "" {
  					return false
  				}
  			}
  
  			// The task started ... is it using LogDog for logging?
  			tags := swarmingTags(res.Tags)
  
  			var err error
  			if logDogStreamAddr, err = resolveLogDogStreamAddrFromTags(tags); err != nil {
  				logging.WithError(err).Debugf(c, "Not using LogDog annotation stream.")
  				return false
  			}
  			return true
  		},
  	}
  	fr, err := swarmingFetch(c, svc, taskID, fetchParams)
  	return fr, logDogStreamAddr, err
  }
docs: // swarmingFetchMaybeLogs fetches the swarming task result.  It also fetches
  // the log iff the task is not a logdog enabled task.