mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
[ls] don't silent the standard error stream
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
This commit is contained in:
parent
fcef1ccdd1
commit
2cfbea4021
2 changed files with 10 additions and 15 deletions
|
@ -104,22 +104,20 @@ class ServerLauncher {
|
|||
|
||||
def static void logStandardStreams(String prefix) {
|
||||
val stdFileOut = new FileOutputStream(prefix + "-debug.log")
|
||||
val stdFileErr = new FileOutputStream(prefix + "-error.log")
|
||||
redirectStandardStreams(stdFileOut, stdFileErr)
|
||||
redirectStandardStreams(stdFileOut)
|
||||
}
|
||||
|
||||
def static void silentStandardStreams() {
|
||||
redirectStandardStreams(ServerLauncher.silentOut, ServerLauncher.silentOut)
|
||||
redirectStandardStreams(ServerLauncher.silentOut)
|
||||
}
|
||||
|
||||
def static void redirectStandardStreams(OutputStream out, OutputStream err) {
|
||||
redirectStandardStreams(ServerLauncher.silentIn, out, err)
|
||||
def static void redirectStandardStreams(OutputStream out) {
|
||||
redirectStandardStreams(ServerLauncher.silentIn, out)
|
||||
}
|
||||
|
||||
def static void redirectStandardStreams(InputStream in, OutputStream out, OutputStream err) {
|
||||
def static void redirectStandardStreams(InputStream in, OutputStream out) {
|
||||
System.setIn(in)
|
||||
System.setOut(new PrintStream(out))
|
||||
System.setErr(new PrintStream(err))
|
||||
}
|
||||
|
||||
def static OutputStream silentOut() {
|
||||
|
|
|
@ -133,27 +133,24 @@ public class ServerLauncher {
|
|||
public static void logStandardStreams(final String prefix) {
|
||||
try {
|
||||
final FileOutputStream stdFileOut = new FileOutputStream((prefix + "-debug.log"));
|
||||
final FileOutputStream stdFileErr = new FileOutputStream((prefix + "-error.log"));
|
||||
ServerLauncher.redirectStandardStreams(stdFileOut, stdFileErr);
|
||||
ServerLauncher.redirectStandardStreams(stdFileOut);
|
||||
} catch (Throwable _e) {
|
||||
throw Exceptions.sneakyThrow(_e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void silentStandardStreams() {
|
||||
ServerLauncher.redirectStandardStreams(ServerLauncher.silentOut(), ServerLauncher.silentOut());
|
||||
ServerLauncher.redirectStandardStreams(ServerLauncher.silentOut());
|
||||
}
|
||||
|
||||
public static void redirectStandardStreams(final OutputStream out, final OutputStream err) {
|
||||
ServerLauncher.redirectStandardStreams(ServerLauncher.silentIn(), out, err);
|
||||
public static void redirectStandardStreams(final OutputStream out) {
|
||||
ServerLauncher.redirectStandardStreams(ServerLauncher.silentIn(), out);
|
||||
}
|
||||
|
||||
public static void redirectStandardStreams(final InputStream in, final OutputStream out, final OutputStream err) {
|
||||
public static void redirectStandardStreams(final InputStream in, final OutputStream out) {
|
||||
System.setIn(in);
|
||||
PrintStream _printStream = new PrintStream(out);
|
||||
System.setOut(_printStream);
|
||||
PrintStream _printStream_1 = new PrintStream(err);
|
||||
System.setErr(_printStream_1);
|
||||
}
|
||||
|
||||
public static OutputStream silentOut() {
|
||||
|
|
Loading…
Reference in a new issue