PATH Documentation > WebObjects

Table of Contents

NSLog.Logger


Inherits from:
Object
Package:
com.webobjects.foundation


Class Description


NSLog.Logger is an abstract class that specifies the core functionality for NSLog.

You can subclass NSLog.Logger to add custom logging implementations based on Email, java.io.PrintWriters, display to a Swing window, etc. To add custom logging implementations based on java.io.PrintStream, subclass NSLog.PrintStreamLogger. If you subclass NSLog.Logger, you need only implement two of the appendln methods: appendln(Object), since the other appendln methods invoke appendln(Object); and appendln(). You must also implement flush() if you subclass.

See the class specification on "NSLog" (page 125) and "NSLog.PrintStreamLogger" (page 145) for more information.




Method Types


Appending to output
appendln
Maintaining logging options
isEnabled
isVerbose
setIsEnabled
setIsVerbose
Flushing the log
flush


Constructors



NSLog.Logger

public NSLog.Logger()

Description forthcoming.


Instance Methods



appendln

public abstract void appendln(Object anObject)

Since this is an abstract method, it does nothing by default. It's up to the subclass to implement the behavior. As implemented in NSLog, this method appends the string representation of anObject to the logging output. For example, a generic object passed to this method might output "java.lang.Object@67e5d". The string representation is derived from the toString() method of the object.

public void appendln(Throwable aThrowable)

Calls appendln(Object anObject) with NSLog.throwableAsString(aThrowable) as an argument.

public void appendln(int anInt)

Calls appendln(Object anObject), by transforming anInt into a Java Integer class object.

public void appendln(float aFloat)

Calls appendln(Object anObject) by transforming aFloat into a Java Float class object.

public void appendln(short aShort)

Calls appendln(Object anObject), by transforming aShort into a Java Short class object.

public void appendln(long aLong)

Calls appendln(Object anObject), by transforming anInt into a Java Long class object.

public void appendln(byte[] aByteArray)

Calls appendln(Object anObject), by transforming aByte[] into a Java String class object.

public void appendln(char[] aCharArray)

Calls appendln(Object anObject), by transforming aChar[] into a Java String class object.

public void appendln(boolean aBoolean)

Calls appendln(Object anObject), passing true if aBoolean is true, false if aBoolean is false.

public void appendln(double aDouble)

Calls appendln(Object anObject), by transforming aDouble into a Java Double class object.

public void appendln(char aChar)

Calls appendln(Object anObject), by transforming aChar[] into a Java String class object.

public void appendln(byte aByte)

Calls appendln(Object anObject), by transforming aByte into a Java Byte class object.

public void appendln()

Since this is an abstract method, it does nothing by default. As implemented in NSLog, this method appends a new line to the logging output.

flush

public abstract void flush()

Since this is an abstract method, it does nothing by default. As implemented in NSLog, this method allows you to flush the internal buffer.

isEnabled

public boolean isEnabled()

Returns the value of an internal boolean, which defaults to true, and is set by setIsEnabled. As implemented in NSLog, the internal boolean regulates whether logging is enabled or disabled. When logging is disabled, the receiver ignores all invocations of appendln. By default, logging is enabled.

isVerbose

public boolean isVerbose()

Returns the value of an internal boolean, which defaults to true, and is set by setIsVerbose. As implemented in NSLog, the internal boolean regulates whether verbose logging is activated or deactivated. See the method description for setIsVerbose for more information. By default, verbose logging is disabled.

setIsEnabled

public void setIsEnabled(boolean aBoolean)

Sets the value of an internal boolean to aBoolean. As implemented in NSLog, the internal boolean disables logging if aBoolean is false. When logging is disabled, the receiver ignores all invocations of appendln. By default, logging is enabled.

setIsVerbose

public void setIsVerbose(boolean aBoolean)

Sets the value of an internal boolean to aBoolean. As implemented in NSLog, the internal boolean enables verbose logging if aBoolean is true. Verbose logging produces output of the format: "[Current Time] <Current Thread Name> object ". By default, verbose logging is disabled in NSLog.

© 2001 Apple Computer, Inc. (Last Published April 17, 2001)


Table of Contents