|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.rode.thesis.meta.log.LogFactory
public class LogFactory
The log factory is the public interface to create and
access logs
.
Implementation notes:
Internally, the factory uses a LogManager
according to
the Singleton pattern.
If the system property dk.rode.thesis.log
is set to
file
, file logs will be created by this manager.
Otherwise the default system out loggers.
LogManager
Field Summary | |
---|---|
private static LogManager |
manager
The singleton log manager that handles the logs. |
Constructor Summary | |
---|---|
private |
LogFactory()
Private no-arg constructor. |
Method Summary | |
---|---|
static Log |
getLog()
Returns the global log. |
static Log |
getLog(Class<?> clazz)
Returns the log associated with the class supplied as clazz , or the global log if clazz is null. |
static Log |
getLog(Object object)
Returns the log associated with the class of the object supplied supplied as object , or the
global log if object is null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static LogManager manager
If the system property dk.rode.thesis.log
is set to
file
, file logs will be created by this manager.
Otherwise the default system out loggers.
Never null.
Constructor Detail |
---|
private LogFactory()
Method Detail |
---|
public static final Log getLog()
public static final Log getLog(Class<?> clazz)
clazz
, or the global log if clazz
is null. The class is tested on identity, and a given super or sub-class will not match.
clazz
- The class to which the log is associated; can be
null for the global log.
public static final Log getLog(Object object)
object
, or the
global log if object
is null. The class is tested on identity, and a given super or sub-class will not match.
object
- The object to deliver the class; can be null
for the global log.
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |