WebObjects 5.2

com.webobjects.foundation
Class NSLog.Logger

java.lang.Object
  |
  +--com.webobjects.foundation.NSLog.Logger
Direct Known Subclasses:
NSLog.PrintStreamLogger
Enclosing class:
NSLog

public abstract static class NSLog.Logger
extends Object

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), and appendln(), since the other appendln methods invoke appendln(Object) and appendln(). You must also implement flush() if you subclass.

See Also:
NSLog, NSLog.PrintStreamLogger

Constructor Summary
NSLog.Logger()
          The default constructor for Logger does nothing.
 
Method Summary
abstract  void appendln()
          Since this is an abstract method, it does nothing by default.
 void appendln(boolean aValue)
          Calls appendln(Object anObject), passing Boolean.TRUE if aValue is true, or Boolean.FALSE if aValue is false.
 void appendln(byte aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java Byte class object.
 void appendln(byte[] aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java String class object, using the default encoding.
 void appendln(char aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java String class object.
 void appendln(char[] aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java String class object.
 void appendln(double aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java Double class object.
 void appendln(float aValue)
          Calls appendln(Object anObject) by transforming aValue into a Java Float class object.
 void appendln(int aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java Integer class object.
 void appendln(long aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java Long class object.
abstract  void appendln(Object aValue)
          Since this is an abstract method, it does nothing by default.
 void appendln(short aValue)
          Calls appendln(Object anObject), by transforming aValue into a Java Short class object.
 void appendln(Throwable aValue)
          Calls appendln(Object anObject) with NSLog.throwableAsString(aValue) as an argument.
abstract  void flush()
          Since this is an abstract method, it does nothing by default.
 boolean isEnabled()
          As implemented in NSLog, the internal boolean regulates whether logging is enabled or disabled.
 boolean isVerbose()
          As implemented in NSLog, the internal boolean regulates whether verbose logging is activated or deactivated.
 void setIsEnabled(boolean aBool)
          Sets the value of an internal boolean to aBool.
 void setIsVerbose(boolean aBool)
          Sets the value of an internal boolean to aBool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NSLog.Logger

public NSLog.Logger()
The default constructor for Logger does nothing.
Method Detail

appendln

public void appendln(boolean aValue)
Calls appendln(Object anObject), passing Boolean.TRUE if aValue is true, or Boolean.FALSE if aValue is false.

Parameters:
aValue - boolean value to append to output

appendln

public void appendln(byte aValue)
Calls appendln(Object anObject), by transforming aValue into a Java Byte class object.

Parameters:
aValue - byte value to append to output

appendln

public void appendln(byte[] aValue)
Calls appendln(Object anObject), by transforming aValue into a Java String class object, using the default encoding.

Parameters:
aValue - byte array to append to output

appendln

public void appendln(char aValue)
Calls appendln(Object anObject), by transforming aValue into a Java String class object.

Parameters:
aValue - char value to append to output

appendln

public void appendln(char[] aValue)
Calls appendln(Object anObject), by transforming aValue into a Java String class object.

Parameters:
aValue - char array to append to output

appendln

public void appendln(double aValue)
Calls appendln(Object anObject), by transforming aValue into a Java Double class object.

Parameters:
aValue - double value to append to output

appendln

public void appendln(float aValue)
Calls appendln(Object anObject) by transforming aValue into a Java Float class object.

Parameters:
aValue - float value to append to output

appendln

public void appendln(int aValue)
Calls appendln(Object anObject), by transforming aValue into a Java Integer class object.

Parameters:
aValue - int value to append to output

appendln

public void appendln(long aValue)
Calls appendln(Object anObject), by transforming aValue into a Java Long class object.

Parameters:
aValue - long value to append to output

appendln

public void appendln(short aValue)
Calls appendln(Object anObject), by transforming aValue into a Java Short class object.

Parameters:
aValue - short value to append to output

appendln

public void appendln(Throwable aValue)
Calls appendln(Object anObject) with NSLog.throwableAsString(aValue) as an argument.

Parameters:
aValue - the Throwable object to append to output

appendln

public abstract void appendln(Object aValue)
Since this is an abstract method, it does nothing by default. It's up to the subclass to implement the behavior. See PrintStreamLogger for the default implementation of this method. Note that this method may represent a race condition, so implementations of this method must either be declared synchronized or otherwise be designed to be thread-safe.
Parameters:
aValue - the object to be appended to the output

appendln

public abstract void appendln()
Since this is an abstract method, it does nothing by default. See PrintStreamLogger for the default implementation of this method.

flush

public abstract void flush()
Since this is an abstract method, it does nothing by default. See PrintStreamLogger for the default implementation of this method.

isEnabled

public boolean isEnabled()
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. Note that it is up to subclass implementations to pay attention to this setting, NSLogger does nothing but maintain state in an instance variable.
Returns:
the value of an internal boolean, which defaults to true, and is set by setIsEnabled
See Also:
setIsEnabled(boolean aBool)

isVerbose

public boolean isVerbose()
As implemented in NSLog, the internal boolean regulates whether verbose logging is activated or deactivated. Note that it is up to subclass implementations to pay attention to this setting, NSLogger does nothing but maintain state in an instance variable.
Returns:
the value of an internal boolean, which defaults to true, and is set by setIsVerbose
See Also:
setIsVerbose(boolean aBool)

setIsEnabled

public void setIsEnabled(boolean aBool)
Sets the value of an internal boolean to aBool. As implemented in NSLog, the internal boolean disables logging if aBool is false. When logging is disabled, the receiver ignores all invocations of appendln. By default, logging is enabled.
Parameters:
aBool - true if logging is to be done else false
See Also:
isEnabled()

setIsVerbose

public void setIsVerbose(boolean aBool)
Sets the value of an internal boolean to aBool. As implemented in NSLog, the internal boolean enables verbose logging if aBool is true. By default, verbose logging is enabled in NSLog.
Parameters:
aBool - true if verbose logging is to be done else false
See Also:
isVerbose()

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.