|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
ccs.utils.LogFile
public class LogFile
Reroute System.out and System.err to a log file. Useful for systems which aren't running under a console (e.g. from a GUI-based bootstrap) which may generate error-messages which you need to trap for debugging / fault finding etc.
Update: This code has rotted - I don't think it ever worked properly. Probably best avoided pending review.
Method Summary | |
---|---|
static void |
reroute(java.io.File f,
boolean isLog)
Deprecated. Reroute system output streams to a file. |
static void |
setLog(boolean value)
Deprecated. Set whether to actually send incoming messages to the log file, or to just swallow them. |
void |
write(byte[] b)
Deprecated. Writes b.length bytes from the specified byte array
to this output stream. |
void |
write(byte[] b,
int off,
int len)
Deprecated. Writes len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Deprecated. Writes the specified byte to the logfile or swallows it. |
Methods inherited from class java.io.OutputStream |
---|
close, flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void reroute(java.io.File f, boolean isLog)
f
- the File to reroute to. If null, the output is swallowed.isLog
- whether to record output: if false, output is swallowed.public static void setLog(boolean value)
value
- true to log, false to swallow.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte
.
java.io.IOException
- if an I/O error occurs.public void write(byte[] b) throws java.io.IOException
b.length
bytes from the specified byte array
to this output stream.
write
in class java.io.OutputStream
b
- the data.
java.io.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.
write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.
java.io.IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |