Skip to content

Commit

Permalink
Merged in PAYARA-3708-4.191.Maintenance (pull request payara#629)
Browse files Browse the repository at this point in the history
PAYARA-3708 - 4.191 Maintenance
  • Loading branch information
Pandrex247 committed Apr 16, 2019
1 parent 62f278b commit 1a2f3a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public abstract class CLICommand implements PostConstruct {
};
private String manpageTokenValues[] = new String[manpageTokens.length];

static{
checkToDisableJLineLogging();
}

/**
* The name of the command. Initialized in the constructor.
*/
Expand Down Expand Up @@ -1364,4 +1368,17 @@ private static void file2Set(String file, Set<String> set) {
e.printStackTrace();
}
}

private static void checkToDisableJLineLogging(){
if (Boolean.getBoolean("fish.payara.admin.command.jline.log.disable")) {
System.setProperty("jline.log.jul", "false");
final OutputStream noOpOutputStream = new OutputStream() {
@Override
public void write(int b) throws IOException {
//NO-OP
}
};
jline.internal.Log.setOutput(new PrintStream(noOpOutputStream));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ protected Collection<ParamModel> usageOptions() {
protected int executeCommand() throws CommandException, CommandValidationException {
ConsoleReader reader = null;
programOpts.setEcho(echo); // restore echo flag, saved in validate
try {
checkToDisableJLineLogging();
try {
if (file == null) {
System.out.println(strings.get("multimodeIntro"));
reader = new ConsoleReader(ASADMIN, System.in, System.out, null, encoding);
Expand Down Expand Up @@ -185,19 +184,6 @@ public void write(byte[] b, int off, int len) throws IOException {
}
}
}

private static void checkToDisableJLineLogging(){
if (Boolean.getBoolean("fish.payara.admin.command.jline.log.disable")) {
System.setProperty("jline.log.jul", "false");
final OutputStream noOpOutputStream = new OutputStream() {
@Override
public void write(int b) throws IOException {
//NO-OP
}
};
jline.internal.Log.setOutput(new PrintStream(noOpOutputStream));
}
}

private static void atomicReplace(ServiceLocator locator, ProgramOptions options) {
DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
Expand Down

0 comments on commit 1a2f3a6

Please sign in to comment.