>        // see https://issues.apache.org/jira/browse/JCLOUDS-570
>        Optional<? extends Image> image = tryFind(images, idPredicate);
> -      if (!image.isPresent()) {
> -         logger.warn("Image %s not found in the image cache. Trying to get 
> it directly...", imageId);
> -         // Note that this might generate make a call to the provider 
> instead of using a cache, but
> -         // this will be executed rarely, only when an image is not present 
> in the image list but
> -         // it actually exists in the provider. It shouldn't be an expensive 
> call so using a cache just for
> -         // this corner case is overkill.
> -         image = Optional.fromNullable(getImageStrategy.getImage(imageId));
> -         if (!image.isPresent()) {
> -            throwNoSuchElementExceptionAfterLoggingImageIds(format("%s not 
> found", idPredicate), images);
> -         }
> +      if (image.isPresent()) {
> +         return image.get();
> +      }
> +
> +      logger.warn("Image %s not found in the image cache. Trying to get it 
> from the provider...", imageId);

> Regarding the log level, I'd rather use warning, as using this "hidden" 
> images is something we might want to notify 

How about INFO, then? I'd agree that this is something users might want to know 
about (i.e. level > DEBUG), but it's not a *problem* as such - you wouldn't 
expect to trigger an alert based on this, for example (i.e. level < WARN)?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/401/files#r13738427

Reply via email to