|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jcifs.util.LogWriter
This class is basically a PrintWriter that prepends
a timestamp before each message is written to the underlying
stream. The methods for printing are a pertainent subset from PrintWriter.
Log| Field Summary | |
Object |
lock
The object used to synchronize operations on this stream |
| Constructor Summary | |
LogWriter(OutputStream out)
Create a new LogWriter instance that uses the specified
output stream as it's underlying stream |
|
LogWriter(Writer out)
Create a new LogWriter instance. |
|
| Method Summary | |
boolean |
checkError()
Flush the stream and check error state |
void |
close()
Close the stream |
void |
println(String desc,
char[] c)
Print an array of char to the log. |
void |
println(String desc,
int i)
Print an int to the log stream. |
void |
println(String desc,
Object o)
Print the string representation of an Object to the screen. |
void |
println(String desc,
String s)
Print a String to the log. |
void |
printStackTrace(String desc,
Throwable t)
This is a pervasive enough feature for a logging utility that it is built in. |
static void |
setDateFormat(String format)
Set the date format used to render the timestamp written with each message. |
void |
setError()
Indicate that an error has occured |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public Object lock
| Constructor Detail |
public LogWriter(Writer out)
LogWriter instance.public LogWriter(OutputStream out)
LogWriter instance that uses the specified
output stream as it's underlying stream| Method Detail |
public static void setDateFormat(String format)
format - the format string usedSimpleDateFormatpublic void close()
public boolean checkError()
public void setError()
public void printStackTrace(String desc,
Throwable t)
desc - a brief description of the source of the message to followt - the Exception to obtain the message to be printed from
public void println(String desc,
int i)
int to the log stream. Keep in mind that every
call to a PrintWriter like method will print a new timestamp.
Using several calls together will not concatonate several messages
together under one timestamp.desc - a brief description of the source of the message to followi - the int to print
public void println(String desc,
char[] c)
char to the log.desc - a brief description of the source of the message to followc - the message
public void println(String desc,
String s)
String to the log.desc - a brief description of the source of the message to follows - the string message
public void println(String desc,
Object o)
Object to the screen.desc - a general description of the source of the messageo - the Object to print
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||