package org.javacs;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.javacs.lsp.*;

public class Main {
    private static final Logger LOG = Logger.getLogger("main");

    public static void setRootFormat() {
        var root = Logger.getLogger("");

        for (var h : root.getHandlers()) h.setFormatter(new LogFormat());
    }

    private JavaLanguageServer createServer(LanguageClient client) {
        return new JavaLanguageServer(client);
    }

    public static void main(String[] args) {
        try {
            // Logger.getLogger("").addHandler(new FileHandler("javacs.%u.log", false));
            setRootFormat();

            LSP.connect(JavaLanguageServer::new, System.in, System.out);
        } catch (Throwable t) {
            LOG.log(Level.SEVERE, t.getMessage(), t);

            System.exit(1);
        }
    }
}

package org.javacs;

import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.javacs.lsp.*;

public class Main {
    private static final Logger LOG = Logger.getLogger("main");

    public static void setRootFormat() {
        var root = Logger.getLogger("");

        for (var h : root.getHandlers()) h.setFormatter(new LogFormat());
    }

    private JavaLanguageServer createServer(LanguageClient client) {
        return new JavaLanguageServer(client);
    }

    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();

            LSP.connect(JavaLanguageServer::new, System.in, System.out);
        } catch (Throwable t) {
            LOG.log(Level.SEVERE, t.getMessage(), t);

            System.exit(1);
        }
    }
}

Add '--quiet' option for standalone usage
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.
