diff options
Diffstat (limited to 'src/cz/crcs/ectester/reader/output/OutputLogger.java')
| -rw-r--r-- | src/cz/crcs/ectester/reader/output/OutputLogger.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/cz/crcs/ectester/reader/output/OutputLogger.java b/src/cz/crcs/ectester/reader/output/OutputLogger.java deleted file mode 100644 index bf47a1f..0000000 --- a/src/cz/crcs/ectester/reader/output/OutputLogger.java +++ /dev/null @@ -1,60 +0,0 @@ -package cz.crcs.ectester.reader.output; - -import java.io.*; -import java.util.LinkedList; -import java.util.List; - -/** - * @author Petr Svenda petr@svenda.com - * @author Jan Jancar johny@neuromancer.sk - */ -public class OutputLogger { - private OutputStream out; - private PrintStream print; - - public OutputLogger(boolean systemOut, String... filePaths) throws IOException { - List<OutputStream> streams = new LinkedList<>(); - for (String filePath : filePaths) { - if (filePath != null) { - streams.add(new FileOutputStream(filePath)); - } - } - if (systemOut) { - streams.add(System.out); - } - this.out = new TeeOutputStream(streams.toArray(new OutputStream[0])); - this.print = new PrintStream(this.out); - } - - public OutputLogger(String filePath) throws IOException { - this(true, filePath); - } - - public OutputStream getOutputStream() { - return this.out; - } - - public PrintStream getPrintStream() { - return this.print; - } - - public void println() { - print.println(); - } - - public void println(String logLine) { - print.println(logLine); - } - - public void print(String logLine) { - print.print(logLine); - } - - public void flush() { - print.flush(); - } - - public void close() { - print.close(); - } -} |
