From 1321f59e5374239f9c0ed2a23fee206e4f15a21d Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Mon, 1 Apr 2019 09:11:12 -0700 Subject: [PATCH] Disable expensive logging of number of source attachements --- .../ide/vscode/boot/jdt/ls/JdtLsProjectCache.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/jdt/ls/JdtLsProjectCache.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/jdt/ls/JdtLsProjectCache.java index 67d02faeb..848893f9d 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/jdt/ls/JdtLsProjectCache.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/jdt/ls/JdtLsProjectCache.java @@ -123,9 +123,12 @@ public class JdtLsProjectCache implements InitializableJavaProjectsService { private void logEvent(String type, IJavaProject project) { try { - log.info("Project "+type+": " + project.getLocationUri()); - log.info("Classpath has "+project.getClasspath().getClasspathEntries().size()+" entries " - +countSourceAttachments(project.getClasspath().getClasspathEntries()) + " source attachements"); + log.info("Project {}: {}", type, project.getLocationUri()); + log.info("Classpath has {} entries", project.getClasspath().getClasspathEntries().size()); + if (log.isDebugEnabled()) { + //Avoid expensive call to countSourceAttachements if possible. + log.debug("Classpath has {} source attachements", countSourceAttachments(project.getClasspath().getClasspathEntries())); + } } catch (Exception e) { } }