Skip to content

Commit 5f89a16

Browse files
JavaLogFactory cleanup
Removing code block to redirect system out & cleaning up imports. If java logging configuration cannot be read, then the originating exception is rewrapped with a more useful message and printed to standard error.
1 parent 6afaab3 commit 5f89a16

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/main/java/org/owasp/esapi/logging/java/JavaLogFactory.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import java.io.IOException;
1818
import java.io.InputStream;
19-
import java.io.OutputStream;
20-
import java.io.PrintStream;
2119
import java.util.ArrayList;
2220
import java.util.HashMap;
2321
import java.util.List;
@@ -80,21 +78,8 @@ public class JavaLogFactory implements LogFactory {
8078
getResourceAsStream("esapi-java-logging.properties")) {
8179
LogManager.getLogManager().readConfiguration(stream);
8280
} catch (IOException ioe) {
83-
ioe.printStackTrace();
81+
System.err.print(new IOException("Failed to load esapi-java-logging.properties.", ioe));
8482
}
85-
86-
/*
87-
* This is a convenience for me -- turns off all System.out.println cruft in the terminal so I can view the logs.
88-
* FIXME: Probably need to remove this before the end of the effort.
89-
*/
90-
/*
91-
System.setOut(new PrintStream(new OutputStream() {
92-
public void write(int b) {
93-
//DO NOTHING
94-
}
95-
}));
96-
97-
*/
9883
}
9984

10085
/**

0 commit comments

Comments
 (0)