diff --git a/src/main/java/com/github/cleydyr/dart/net/NetworkingGithubLatestVersionProvider.java b/src/main/java/com/github/cleydyr/dart/net/NetworkingGithubLatestVersionProvider.java index 969f443..320ce2a 100644 --- a/src/main/java/com/github/cleydyr/dart/net/NetworkingGithubLatestVersionProvider.java +++ b/src/main/java/com/github/cleydyr/dart/net/NetworkingGithubLatestVersionProvider.java @@ -55,27 +55,37 @@ public void onError(GitHubConnectorResponse ghcr) throws IOException { PagedIterable ghReleases = repository.listReleases(); for (GHRelease ghRelease : ghReleases) { - logger.debug("Checking release " + ghRelease.getName()); + if (logger.isDebugEnabled()) { + logger.debug("Checking release " + ghRelease.getName()); + } String version = ghRelease.getTagName(); DartSassReleaseParameter dartSassReleaseParameter = new DartSassReleaseParameter(os, arch, version); for (GHAsset ghAsset : ghRelease.listAssets()) { - logger.debug("Checking asset " + ghAsset.getName()); + if (logger.isDebugEnabled()) { + logger.debug("Checking asset " + ghAsset.getName()); + } if (ghAsset.getName().equals(dartSassReleaseParameter.getArtifactName())) { return version; } } - logger.info("Skipping version " + version + " because it doesn't have a matching asset"); + if (logger.isInfoEnabled()) { + logger.info("Skipping version " + version + " because it doesn't have a matching asset"); + } } } catch (IOException e) { - logger.warn("Error while getting latest version from GitHub API", e); + if (logger.isWarnEnabled()) { + logger.warn("Error while getting latest version from GitHub API", e); + } } - logger.warn("Falling back to latest known release (" + fallbackVersionProvider.get(os, arch) + ")"); + if (logger.isWarnEnabled()) { + logger.warn("Falling back to latest known release (" + fallbackVersionProvider.get(os, arch) + ")"); + } return fallbackVersionProvider.get(os, arch); }