|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.ui.util.SystemOutUtilities
public class SystemOutUtilities
A class that allow redirection of stderr and/or stdout to a log file. Invokation of this class must be done with "SystemOutUtilities.instance()" which return a reference to the singleton.
Field Summary | |
---|---|
static int |
FILE
redirects stdout to a file named "jPicedtError.log" |
static int |
STANDARD
doesn't redirect stdout to a file, ie redirect to console ; instead open a frame and displays the error message in it |
Method Summary | |
---|---|
void |
displayDialog(boolean state)
Sets the "displayDialog" flag, ie what must happen when an error message comes up and redir=FILE : do we open a JDialog or simply write the error message to the log file ? |
static String |
getErrorLogFile()
Return the path to error.log |
static SystemOutUtilities |
instance()
intanciates singleton if it's null, then returns it |
void |
redirect(int type)
Redirect to the stream of the given type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STANDARD
public static final int FILE
Method Detail |
---|
public static SystemOutUtilities instance()
public void redirect(int type)
type
- one of the predefinite SystemOutUtilities's redirection typespublic void displayDialog(boolean state)
state
- if currentRedir = FILE and :
- state==TRUE, enables opening a dialog box whenever some String is written to System.out
A "watchdog" Thread is created for that purpose : System.out is redirected to a pipe, which the Thread watches periodically.
- state==FALSE, redirect System.out directly to the "toFilePrintStream" FOS, and kill the watchdog Thread if it's still alive.
Otherwise (ie currentRedir = STANDARD), we do nothing.public static String getErrorLogFile()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |