diff --git a/gradle-consistent-versions-idea-plugin/build.gradle b/gradle-consistent-versions-idea-plugin/build.gradle index 87c90bb..a07b416 100644 --- a/gradle-consistent-versions-idea-plugin/build.gradle +++ b/gradle-consistent-versions-idea-plugin/build.gradle @@ -30,6 +30,7 @@ dependencies { compileOnly 'org.immutables:value::annotations' testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.assertj:assertj-core' + implementation 'com.palantir.safe-logging:logger' } grammarKit { diff --git a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/ContentsUtil.java b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/ContentsUtil.java index ad341f0..770c76e 100644 --- a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/ContentsUtil.java +++ b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/ContentsUtil.java @@ -20,6 +20,8 @@ import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; +import com.palantir.logsafe.logger.SafeLogger; +import com.palantir.logsafe.logger.SafeLoggerFactory; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; @@ -28,11 +30,9 @@ import java.util.Optional; import java.util.concurrent.Callable; import java.util.concurrent.Future; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public final class ContentsUtil { - private static final Logger log = LoggerFactory.getLogger(ContentsUtil.class); + private static final SafeLogger log = SafeLoggerFactory.get(ContentsUtil.class); public static Optional fetchPageContents(URL pageUrl) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); diff --git a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/LoadCacheOnGradleProjectRefresh.java b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/LoadCacheOnGradleProjectRefresh.java index f2390b4..cbe6fc6 100644 --- a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/LoadCacheOnGradleProjectRefresh.java +++ b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/LoadCacheOnGradleProjectRefresh.java @@ -20,12 +20,12 @@ import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent; import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType; +import com.palantir.logsafe.logger.SafeLogger; +import com.palantir.logsafe.logger.SafeLoggerFactory; import org.jetbrains.plugins.gradle.util.GradleConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class LoadCacheOnGradleProjectRefresh implements ExternalSystemTaskNotificationListener { - private static final Logger log = LoggerFactory.getLogger(LoadCacheOnGradleProjectRefresh.class); + private static final SafeLogger log = SafeLoggerFactory.get(LoadCacheOnGradleProjectRefresh.class); @Override public final void onSuccess(ExternalSystemTaskId id) { diff --git a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryExplorer.java b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryExplorer.java index 979ee04..b261957 100644 --- a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryExplorer.java +++ b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryExplorer.java @@ -19,6 +19,8 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import com.palantir.logsafe.logger.SafeLogger; +import com.palantir.logsafe.logger.SafeLoggerFactory; import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; @@ -31,11 +33,9 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class RepositoryExplorer { - private static final Logger log = LoggerFactory.getLogger(RepositoryExplorer.class); + private static final SafeLogger log = SafeLoggerFactory.get(RepositoryExplorer.class); private final Cache> folderCache = Caffeine.newBuilder() .expireAfterWrite(10, TimeUnit.MINUTES) diff --git a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryLoader.java b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryLoader.java index f29573d..63bfcdd 100644 --- a/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryLoader.java +++ b/gradle-consistent-versions-idea-plugin/src/main/java/com/palantir/gradle/versions/intellij/RepositoryLoader.java @@ -25,6 +25,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.datatype.guava.GuavaModule; import com.intellij.openapi.project.Project; +import com.palantir.logsafe.logger.SafeLogger; +import com.palantir.logsafe.logger.SafeLoggerFactory; import java.io.File; import java.io.IOException; import java.util.LinkedHashSet; @@ -32,11 +34,9 @@ import java.util.Set; import java.util.stream.Collectors; import org.immutables.value.Value; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public final class RepositoryLoader { - private static final Logger log = LoggerFactory.getLogger(RepositoryExplorer.class); + private static final SafeLogger log = SafeLoggerFactory.get(RepositoryExplorer.class); private static final ObjectMapper XML_MAPPER = new XmlMapper().registerModule(new GuavaModule()); private static final String MAVEN_REPOSITORIES_FILE_NAME = ".idea/gcv-maven-repositories.xml";