This is an automated email from the ASF dual-hosted git repository. mkevo pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new a88c8b55c5 GEODE-10055: fix AbstractLauncher to print info and debug with stdout (#7368) a88c8b55c5 is described below commit a88c8b55c52f31539cf2e940c2d444b97a69e92f Author: Mario Kevo <48509719+mk...@users.noreply.github.com> AuthorDate: Tue Jul 12 09:24:13 2022 +0200 GEODE-10055: fix AbstractLauncher to print info and debug with stdout (#7368) * GEODE-10055: fix AbstractLauncher to print info and debug with stdout instead of stderr --- .../apache/geode/distributed/AbstractLauncher.java | 21 +++++++++++---------- .../apache/geode/distributed/LocatorLauncher.java | 4 ++-- .../apache/geode/distributed/ServerLauncher.java | 5 +++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java index 2fb828a186..9712e76485 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java @@ -356,13 +356,14 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna } /** - * Prints the specified debug message to standard err, replacing any placeholder values with the + * Prints the specified debug message to standard output, replacing any placeholder values with + * the * specified arguments on output, if debugging has been enabled. * - * @param message the String value written to standard err. + * @param message the String value written to standard output. * @param args an Object array containing arguments to replace the placeholder values in the * message. - * @see java.lang.System#err + * @see java.lang.System#out * @see #isDebugging() * @see #debug(Throwable) * @see #info(Object, Object...) @@ -370,9 +371,9 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna protected void debug(final String message, final Object... args) { if (isDebugging()) { if (args != null && args.length > 0) { - System.err.printf(message, args); + System.out.printf(message, args); } else { - System.err.print(message); + System.out.print(message); } } } @@ -392,20 +393,20 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna } /** - * Prints the specified informational message to standard err, replacing any placeholder values + * Prints the specified informational message to standard out, replacing any placeholder values * with the specified arguments on output. * - * @param message the String value written to standard err. + * @param message the String value written to standard out. * @param args an Object array containing arguments to replace the placeholder values in the * message. - * @see java.lang.System#err + * @see java.lang.System#out * @see #debug(String, Object...) */ protected void info(final Object message, final Object... args) { if (args != null && args.length > 0) { - System.err.printf(message.toString(), args); + System.out.printf("%s %s", message, args); } else { - System.err.print(message); + System.out.print(message); } } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java index 8130939dc9..68a22cf882 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java @@ -623,7 +623,7 @@ public class LocatorLauncher extends AbstractLauncher<String> { } /** - * Displays help for the specified Locator launcher command to standard err. If the Locator + * Displays help for the specified Locator launcher command to standard output. If the Locator * launcher command is unspecified, then usage information is displayed instead. * * @param command the Locator launcher command in which to display help information. @@ -648,7 +648,7 @@ public class LocatorLauncher extends AbstractLauncher<String> { /** * Displays usage information on the proper invocation of the LocatorLauncher from the - * command-line to standard err. + * command-line to standard output. * * @see #help(org.apache.geode.distributed.LocatorLauncher.Command) */ diff --git a/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java index 718f558966..257ad60953 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java @@ -687,7 +687,8 @@ public class ServerLauncher extends AbstractLauncher<String> { private static final String TWO_NEW_LINES = lineSeparator() + lineSeparator(); /** - * Displays help for the specified Server launcher command to standard err. If the Server launcher + * Displays help for the specified Server launcher command to standard output. If the Server + * launcher * command is unspecified, then usage information is displayed instead. * * @param command the Server launcher command in which to display help information. @@ -712,7 +713,7 @@ public class ServerLauncher extends AbstractLauncher<String> { /** * Displays usage information on the proper invocation of the ServerLauncher from the command-line - * to standard err. + * to standard output. * * @see #help(ServerLauncher.Command) */