wt.util
Class LogFile
java.lang.Object
wt.util.LogFile
- public class LogFile
- extends Object
A convenience class for redirecting system output and error streams to a log file.
It uses the LogOutputStream
class to add log information to these streams.
This should only be used in an application main method. The System.out
and System.err
streams are static finals. Optimizing JIT compilers are allowed
to perform optimzations on such variables that will produce possibly fatal runtime errors
if they are changed later.
- See Also:
LogOutputStream
Method Summary |
static void |
init(String name,
boolean append,
boolean tee)
Creates a log file with the specified system dependent file name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
versionID
private static final String versionID
- See Also:
- Constant Field Values
LogFile
public LogFile()
init
public static void init(String name,
boolean append,
boolean tee)
throws IOException
- Creates a log file with the specified system dependent file name.
The standard system output and error streams are redirected to this log file.
Parent directories are automatically created if they do not exist.
This should only be used in an application main method. The System.out
and System.err
streams are static finals. Optimizing JIT compilers are allowed
to perform optimzations on such variables that will produce possibly fatal runtime errors
if they are changed later.
- Parameters:
name
- the system dependent file nameappend
- open file in append mode?tee
- tee output to both log file and current standard streams
- Throws:
IOException
- If the file cannot be opened.