From 39259b3919e87a123150df01b0f57dcddeb3703c Mon Sep 17 00:00:00 2001 From: nsingh Date: Wed, 2 May 2018 06:28:37 -0400 Subject: [PATCH] Use slf4j logger --- .../boot/java/utils/SpringLiveHoverWatchdog.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringLiveHoverWatchdog.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringLiveHoverWatchdog.java index 886c62a1c..a46e5c29e 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringLiveHoverWatchdog.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringLiveHoverWatchdog.java @@ -20,17 +20,16 @@ import java.util.stream.Stream; import org.eclipse.lsp4j.Range; import org.eclipse.lsp4j.TextDocumentIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider; -import org.springframework.ide.vscode.boot.java.handlers.HoverProvider; import org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider; import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp; import org.springframework.ide.vscode.commons.java.IJavaProject; import org.springframework.ide.vscode.commons.languageserver.HighlightParams; import org.springframework.ide.vscode.commons.languageserver.java.JavaProjectFinder; import org.springframework.ide.vscode.commons.languageserver.java.ProjectObserver; -import org.springframework.ide.vscode.commons.languageserver.util.HoverHandler; import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer; -import org.springframework.ide.vscode.commons.util.Log; import org.springframework.ide.vscode.commons.util.text.TextDocument; /** @@ -40,6 +39,8 @@ public class SpringLiveHoverWatchdog { public static final Duration DEFAULT_INTERVAL = Duration.ofMillis(5000); + + Logger logger = LoggerFactory.getLogger(SpringLiveHoverWatchdog.class); private final long POLLING_INTERVAL_MILLISECONDS; private final Set watchedDocs; @@ -101,7 +102,7 @@ public class SpringLiveHoverWatchdog { private synchronized void start() { if (highlightsEnabled && timer == null) { - Log.debug("Starting SpringLiveHoverWatchdog"); + logger.debug("Starting SpringLiveHoverWatchdog"); this.timer = new Timer(); TimerTask task = new TimerTask() { @@ -117,7 +118,7 @@ public class SpringLiveHoverWatchdog { public synchronized void shutdown() { if (timer != null) { - Log.info("Shutting down SpringLiveHoverWatchdog"); + logger.info("Shutting down SpringLiveHoverWatchdog"); timer.cancel(); timer = null; watchedDocs.forEach(uri -> cleanupLiveHints(uri)); @@ -159,7 +160,7 @@ public class SpringLiveHoverWatchdog { } } catch (Exception e) { - e.printStackTrace(); + logger.error("", e); } } } @@ -172,7 +173,7 @@ public class SpringLiveHoverWatchdog { update(docURI, runningBootApps); } } catch (Exception e) { - e.printStackTrace(); + logger.error("", e); } } }