|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.webobjects.foundation.NSLog.Logger | +--com.webobjects.foundation.NSLog.PrintStreamLogger
NSLog.PrintStreamLogger is a concrete subclass of NSLog.Logger. It logs output to a java.io.PrintStream which is contained by the logger. This PrintStream can be changed, which causes the receiver to output log messages somewhere else, such as a local file. Methods are provided to enable and disable logging, and to enable and disable verbose logging.
NSLog.out is a PrintStreamLogger that point at System.out, and has verbose logging disabled. NSLog.err and NSLog.debug are PrintStreamLoggers that points to System.err, and have verbose logging enabled.
NSLog.PrintStreamLogger looks at the value of the internal variables set by
NSLog.Logger.setIsVerbose()
and
NSLog.Logger.setIsEnabled()
to determine
whether to produce verbose output and to determine whether to log
messages to the logger.
Verbose logging produces output of the format: "[Current Time] <Current Thread Name> output ".
NSLog
,
NSLog.Logger
Constructor Summary | |
NSLog.PrintStreamLogger()
Creates a new NSLog.PrintStreamLogger which directs output to System.out. |
|
NSLog.PrintStreamLogger(PrintStream ps)
Creates a new NSLog.PrintStreamLogger which directs output to ps . |
Method Summary | |
void |
appendln()
Writes a new line to the receiver's PrintStream, if isEnabled returns true. |
void |
appendln(Object aValue)
Writes aValue to the receiver's PrintStream. |
void |
appendln(Throwable aValue)
Writes the stack trace of aValue to the receiver's
PrintStream. |
void |
flush()
Invokes the underlying PrintStream's flush method. |
PrintStream |
printStream()
|
void |
setPrintStream(PrintStream aStream)
Sets the receiver's print stream to aPrintStream . |
Methods inherited from class com.webobjects.foundation.NSLog.Logger |
appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, isEnabled, isVerbose, setIsEnabled, setIsVerbose |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NSLog.PrintStreamLogger()
public NSLog.PrintStreamLogger(PrintStream ps)
ps
.
Throws an IllegalArgumentException
if
aPrintStream
is null
.ps
- the PrintSteam to direct output toIllegalArgumentException
- if the input
string is null.Method Detail |
public void appendln()
appendln
in class NSLog.Logger
public void appendln(Throwable aValue)
aValue
to the receiver's
PrintStream. This is overridden here for efficiency.appendln
in class NSLog.Logger
aValue
- the message to be appended with the Java objectpublic void appendln(Object aValue)
aValue
to the receiver's PrintStream. This method
appends the string representation of aValue
to the logging output, potentially surrounded by the verbose prefix.
toString
method of the object.
appendln
in class NSLog.Logger
aValue
- the Java object to be appendedpublic void flush()
flush
method.flush
in class NSLog.Logger
public PrintStream printStream()
public void setPrintStream(PrintStream aStream)
aPrintStream
.
This redirects all of the receiver's output.aStream
- the input print stream
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |