code: func updateLogDriver(flags *pflag.FlagSet, taskTemplate *swarm.TaskSpec) error {
  	if !flags.Changed(flagLogDriver) {
  		return nil
  	}
  
  	name, err := flags.GetString(flagLogDriver)
  	if err != nil {
  		return err
  	}
  
  	if name == "" {
  		return nil
  	}
  
  	taskTemplate.LogDriver = &swarm.Driver{
  		Name:    name,
  		Options: opts.ConvertKVStringsToMap(flags.Lookup(flagLogOpt).Value.(*opts.ListOpts).GetAll()),
  	}
  
  	return nil
  }
docs: // updateLogDriver updates the log driver only if the log driver flag is set.
  // All options will be replaced with those provided on the command line.