org.logicalcobwebs.logging
Class LogSource

java.lang.Object
  extended by org.logicalcobwebs.logging.LogSource

Deprecated. Use LogFactory instead - The default factory implementation performs exactly the same algorithm as this class did

public class LogSource
extends java.lang.Object

Factory for creating Log instances. Applications should call the makeNewLogInstance() method to instantiate new instances of the configured Log implementation class.

By default, calling getInstance() will use the following algorithm:

You can change the default behavior in one of two ways:

Version:
$Id: LogSource.java,v 1.3 2003/03/11 00:02:06 billhorsman Exp $
Author:
Rod Waldhoff

Field Summary
private static boolean jdk14IsAvailable
          Deprecated. Is JD 1.4 logging available
private static boolean log4jIsAvailable
          Deprecated. Is log4j available (in the current classpath)
private static java.lang.reflect.Constructor logImplctor
          Deprecated. Constructor for current log class
private static java.util.Hashtable logs
          Deprecated.  
 
Constructor Summary
private LogSource()
          Deprecated. Don't allow others to create instances
 
Method Summary
static Log getInstance(java.lang.Class clazz)
          Deprecated. Get a Log instance by class
static Log getInstance(java.lang.String name)
          Deprecated. Get a Log instance by class name
static java.lang.String[] getLogNames()
          Deprecated. Returns a String array containing the names of all logs known to me.
static Log makeNewLogInstance(java.lang.String name)
          Deprecated. Create a new Log implementation, based on the given name.
static void setLogImplementation(java.lang.Class logclass)
          Deprecated. Set the log implementation/log implementation factory by class.
static void setLogImplementation(java.lang.String classname)
          Deprecated. Set the log implementation/log implementation factory by the name of the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logs

private static java.util.Hashtable logs
Deprecated. 

log4jIsAvailable

private static boolean log4jIsAvailable
Deprecated. 
Is log4j available (in the current classpath)


jdk14IsAvailable

private static boolean jdk14IsAvailable
Deprecated. 
Is JD 1.4 logging available


logImplctor

private static java.lang.reflect.Constructor logImplctor
Deprecated. 
Constructor for current log class

Constructor Detail

LogSource

private LogSource()
Deprecated. 
Don't allow others to create instances

Method Detail

setLogImplementation

public static void setLogImplementation(java.lang.String classname)
                                 throws java.lang.LinkageError,
                                        java.lang.ExceptionInInitializerError,
                                        java.lang.SecurityException
Deprecated. 
Set the log implementation/log implementation factory by the name of the class. The given class must implement Log, and provide a constructor that takes a single String argument (containing the name of the log).

Throws:
java.lang.LinkageError
java.lang.ExceptionInInitializerError
java.lang.SecurityException

setLogImplementation

public static void setLogImplementation(java.lang.Class logclass)
                                 throws java.lang.LinkageError,
                                        java.lang.ExceptionInInitializerError,
                                        java.lang.NoSuchMethodException,
                                        java.lang.SecurityException
Deprecated. 
Set the log implementation/log implementation factory by class. The given class must implement Log, and provide a constructor that takes a single String argument (containing the name of the log).

Throws:
java.lang.LinkageError
java.lang.ExceptionInInitializerError
java.lang.NoSuchMethodException
java.lang.SecurityException

getInstance

public static Log getInstance(java.lang.String name)
Deprecated. 
Get a Log instance by class name


getInstance

public static Log getInstance(java.lang.Class clazz)
Deprecated. 
Get a Log instance by class


makeNewLogInstance

public static Log makeNewLogInstance(java.lang.String name)
Deprecated. 
Create a new Log implementation, based on the given name.

The specific Log implementation returned is determined by the value of the org.apache.commons.logging.log property. The value of org.apache.commons.logging.log may be set to the fully specified name of a class that implements the Log interface. This class must also have a public constructor that takes a single String argument (containing the name of the Log to be constructed.

When org.apache.commons.logging.log is not set, or when no corresponding class can be found, this method will return a Log4JCategoryLog if the log4j Category class is available in the LogSource's classpath, or a Jdk14Logger if we are on a JDK 1.4 or later system, or NoOpLog if neither of the above conditions is true.

Parameters:
name - the log name (or category)

getLogNames

public static java.lang.String[] getLogNames()
Deprecated. 
Returns a String array containing the names of all logs known to me.