code: func (a *Archivist) ArchiveTask(c context.Context, task *logdog.ArchiveTask) error {
  	c = log.SetFields(c, log.Fields{
  		"project": task.Project,
  		"id":      task.Id,
  	})
  	log.Debugf(c, "Received archival task.")
  
  	err := a.archiveTaskImpl(c, task)
  
  	failure := isFailure(err)
  	log.Fields{
  		log.ErrorKey: err,
  		"failure":    failure,
  	}.Infof(c, "Finished archive task.")
  
  	// Add a result metric.
  	tsCount.Add(c, 1, !failure)
  
  	return err
  }
docs: // ArchiveTask processes and executes a single log stream archive task.
  //
  // If the supplied Context is Done, operation may terminate before completion,
  // returning the Context's error.