Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LOGMGR-175] Revert the change to use the StandardOutputStreams on th… #140

Merged
merged 1 commit into from
Sep 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
*/
@SuppressWarnings("WeakerAccess")
@SuppressWarnings({"WeakerAccess", "unused"})
public class StandardOutputStreams {
public static final PrintStream stdout = System.out;
public static final PrintStream stderr = System.err;
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/jboss/logmanager/handlers/ConsoleHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@

import java.util.logging.Formatter;

import org.jboss.logmanager.StandardOutputStreams;
import org.jboss.logmanager.formatters.Formatters;

/**
* A console handler which writes to {@code System.out} by default.
*/
public class ConsoleHandler extends OutputStreamHandler {
private static final OutputStream out = System.out;
private static final OutputStream err = System.err;

/**
* The target stream type.
Expand Down Expand Up @@ -94,8 +95,8 @@ public ConsoleHandler(final Target target) {
public ConsoleHandler(final Target target, final Formatter formatter) {
super(formatter);
switch (target) {
case SYSTEM_OUT: setOutputStream(wrap(StandardOutputStreams.stdout)); break;
case SYSTEM_ERR: setOutputStream(wrap(StandardOutputStreams.stderr)); break;
case SYSTEM_OUT: setOutputStream(wrap(out)); break;
case SYSTEM_ERR: setOutputStream(wrap(err)); break;
case CONSOLE: setWriter(wrap(console)); break;
default: throw new IllegalArgumentException();
}
Expand All @@ -108,8 +109,8 @@ public ConsoleHandler(final Target target, final Formatter formatter) {
*/
public void setTarget(Target target) {
switch (target) {
case SYSTEM_OUT: setOutputStream(wrap(StandardOutputStreams.stdout)); break;
case SYSTEM_ERR: setOutputStream(wrap(StandardOutputStreams.stderr)); break;
case SYSTEM_OUT: setOutputStream(wrap(out)); break;
case SYSTEM_ERR: setOutputStream(wrap(err)); break;
case CONSOLE: setWriter(wrap(console)); break;
default: throw new IllegalArgumentException();
}
Expand Down