Skip to content

Commit

Permalink
Print errors to standard error if flag set
Browse files Browse the repository at this point in the history
If the environment variable `LEMMINX_DEBUG` is set,
then Java's errors will not be disconnected from standard error.

Closes eclipse-lemminx#1019

Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 committed Apr 20, 2021
1 parent 4c7c713 commit 90322bb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static void main(String[] args) {
final String HTTP_PROXY_PORT = System.getenv("HTTP_PROXY_PORT");
final String HTTP_PROXY_USERNAME = System.getenv("HTTP_PROXY_USERNAME");
final String HTTP_PROXY_PASSWORD = System.getenv("HTTP_PROXY_PASSWORD");
final boolean LEMMINX_DEBUG = System.getenv("LEMMINX_DEBUG") != null;

if (HTTP_PROXY_HOST != null && HTTP_PROXY_PORT != null) {
System.setProperty("http.proxyHost", HTTP_PROXY_HOST);
Expand Down Expand Up @@ -70,7 +71,9 @@ protected PasswordAuthentication getPasswordAuthentication() {
PrintStream out = System.out;
System.setIn(new NoOpInputStream());
System.setOut(new NoOpPrintStream());
System.setErr(new NoOpPrintStream());
if (!LEMMINX_DEBUG) {
System.setErr(new NoOpPrintStream());
}
launch(in, out);
}

Expand Down

0 comments on commit 90322bb

Please sign in to comment.