code: func ValidateLogOpts(name string, cfg map[string]string) error {
  	if name == "none" {
  		return nil
  	}
  
  	switch containertypes.LogMode(cfg["mode"]) {
  	case containertypes.LogModeBlocking, containertypes.LogModeNonBlock, containertypes.LogModeUnset:
  	default:
  		return fmt.Errorf("logger: logging mode not supported: %s", cfg["mode"])
  	}
  
  	if s, ok := cfg["max-buffer-size"]; ok {
  		if containertypes.LogMode(cfg["mode"]) != containertypes.LogModeNonBlock {
  			return fmt.Errorf("logger: max-buffer-size option is only supported with 'mode=%s'", containertypes.LogModeNonBlock)
  		}
  		if _, err := units.RAMInBytes(s); err != nil {
  			return errors.Wrap(err, "error parsing option max-buffer-size")
  		}
  	}
  
  	if !factory.driverRegistered(name) {
  		return fmt.Errorf("logger: no log driver named '%s' is registered", name)
  	}
  
  	filteredOpts := make(map[string]string, len(builtInLogOpts))
  	for k, v := range cfg {
  		if !builtInLogOpts[k] {
  			filteredOpts[k] = v
  		}
  	}
  
  	validator := factory.getLogOptValidator(name)
  	if validator != nil {
  		return validator(filteredOpts)
  	}
  	return nil
  }
docs: // ValidateLogOpts checks the options for the given log driver. The
  // options supported are specific to the LogDriver implementation.