summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeigh McCulloch <leigh@mcchouse.com>2019-02-17 23:50:37 +0000
committerGeorge Fraser <george@fivetran.com>2019-02-17 16:12:05 -0800
commit0ac7209274c92c7e039224d0d0bc2b197cf0eef8 (patch)
treed282dc65e191a61874b85ce2065f943cd80ec943
parent423f17d4aba2986f74c2a335ff0c03223d1ade8a (diff)
downloadjava-language-server-0ac7209274c92c7e039224d0d0bc2b197cf0eef8.zip
Add '--quiet' option for standalone usage
What === Add '--quiet' option for standalone usage. When provided the logger will be turned off resulting in no information writing to stderr. Why === When using standalone with IDEs like vim and plugins like vim-lsc the stderr of the command will be outputted into the terminal. This tool is pretty noisy and writes a lot of information which is great for development of the tool but not when using it day-to-day.
-rw-r--r--src/main/java/org/javacs/Main.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/javacs/Main.java b/src/main/java/org/javacs/Main.java
index f8dd455..e8dc57a 100644
--- a/src/main/java/org/javacs/Main.java
+++ b/src/main/java/org/javacs/Main.java
@@ -1,5 +1,6 @@
package org.javacs;
+import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.javacs.lsp.*;
@@ -18,6 +19,12 @@ public class Main {
}
public static void main(String[] args) {
+ boolean quiet = Arrays.stream(args).anyMatch("--quiet"::equals);
+
+ if (quiet) {
+ LOG.setLevel(Level.OFF);
+ }
+
try {
// Logger.getLogger("").addHandler(new FileHandler("javacs.%u.log", false));
setRootFormat();