Thanks to the TeeStream, standard output and standard error are now

written to, in addition to writing to the .log file.
This commit is contained in:
dchandler 2002-10-04 04:52:41 +00:00
parent ef60ccb31b
commit 635b707067
3 changed files with 957 additions and 948 deletions

View file

@ -27,15 +27,22 @@ import java.awt.event.*;
import javax.swing.text.*; import javax.swing.text.*;
import javax.swing.text.rtf.*; import javax.swing.text.rtf.*;
import org.thdl.util.TeeStream;
public class QDShell extends JFrame { public class QDShell extends JFrame {
ResourceBundle messages = null; ResourceBundle messages = null;
QD qd = null; QD qd = null;
public static void main(String[] args) { public static void main(String[] args) {
try { try {
PrintStream ps = new PrintStream(new FileOutputStream("qd.log")); PrintStream psOut
System.setErr(ps); = new TeeStream(System.out,
System.setOut(ps); new PrintStream(new FileOutputStream("qd.log")));
PrintStream psErr
= new TeeStream(System.err,
new PrintStream(new FileOutputStream("qd.log")));
System.setErr(psErr);
System.setOut(psOut);
} }
catch (Exception e) { catch (Exception e) {
} }

View file

@ -29,6 +29,7 @@ import javax.swing.text.rtf.*;
import org.thdl.savant.ucuchi.*; import org.thdl.savant.ucuchi.*;
import org.thdl.savant.tib.*; import org.thdl.savant.tib.*;
import org.thdl.util.TeeStream;
public class SavantShell extends JFrame public class SavantShell extends JFrame
{ {
@ -43,9 +44,14 @@ public class SavantShell extends JFrame
public static void main(String[] args) { public static void main(String[] args) {
try { try {
java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream("savant.log")); PrintStream psOut
System.setErr(ps); = new TeeStream(System.out,
System.setOut(ps); new PrintStream(new FileOutputStream("savant.log")));
PrintStream psErr
= new TeeStream(System.err,
new PrintStream(new FileOutputStream("savant.log")));
System.setErr(psErr);
System.setOut(psOut);
} }
catch (Exception e) { catch (Exception e) {
} }

File diff suppressed because it is too large Load diff