output as stdout instead of stderr

This commit is contained in:
Connor Tumbleson 2013-09-14 12:37:49 -05:00
parent d4b86475ca
commit acd335f92d

View File

@ -480,11 +480,36 @@ public class Main {
for (Handler handler : logger.getHandlers()) {
logger.removeHandler(handler);
}
LogManager.getLogManager().reset();
if (verbosity == Verbosity.QUIET) {
return;
}
Handler handler = new ConsoleHandler();
Handler handler = new Handler(){
@Override
public void publish(LogRecord record) {
if (getFormatter() == null) {
setFormatter(new SimpleFormatter());
}
try {
String message = getFormatter().format(record);
if (record.getLevel().intValue() >= Level.WARNING.intValue()) {
System.err.write(message.getBytes());
} else {
System.out.write(message.getBytes());
}
} catch (Exception exception) {
reportError(null, exception, ErrorManager.FORMAT_FAILURE);
}
}
@Override
public void close() throws SecurityException {}
@Override
public void flush(){}
};
logger.addHandler(handler);
if (verbosity == Verbosity.VERBOSE) {