|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.util.log.LoggerFactory
public abstract class LoggerFactory
The LoggerFactory
is a factory for creating ILogger
instances,
for the configured log technology.
To use the configured log factory implement the following call in your starter:
LoggerFactory.init("com.package.log.MyLoggerFactory");
Later you can create an ILogger
instance and use it as follows:
ILogger logger = LoggerFactory.getInstance("com.project.MyWindow");
logger.debug("My first log message!");
.
Constructor Summary | |
---|---|
protected |
LoggerFactory()
Invisible constructor, because the LoggerFactory is a utility class. |
Method Summary | |
---|---|
abstract ILogger |
createLogger(String pName)
Gets an ILogger . |
static ILogger |
getInstance(Class pClass)
Construct (if necessary) and return an ILogger instance, using the factory's
current set of configuration attributes. |
static ILogger |
getInstance(String pName)
Construct (if necessary) and return an ILogger instance, using the factory's
current set of configuration attributes. |
static ILogger.LogLevel |
getLevel(Class pClass)
Gets the level of a specific logger. |
static ILogger.LogLevel |
getLevel(String pName)
Gets the level of a specific logger. |
static List<ILogger> |
getLogger()
Gets all created logger instances. |
abstract void |
init()
Initializes the factory instance. |
static void |
init(String pClassName)
Creates a new instance of LoggerFactory . |
static void |
setLevel(Class pClass,
ILogger.LogLevel pLevel)
Sets the level of a specific logger. |
static void |
setLevel(String pName,
ILogger.LogLevel pLevel)
Sets the level of a specific logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LoggerFactory()
LoggerFactory
is a utility class.
Method Detail |
---|
public abstract ILogger createLogger(String pName)
ILogger
.
pName
- the name for which a logger should be returned/created
ILogger
implementationpublic abstract void init()
public static void init(String pClassName)
LoggerFactory
. If the pClassName
was not
found then the JdkLoggerFactory
will be instantiated.
pClassName
- the log factory implementationpublic static ILogger getInstance(Class pClass)
ILogger
instance, using the factory's
current set of configuration attributes.
pClass
- the class for which a logger should be returned/created
RuntimeException
- if the log factory was not initializedgetInstance(String)
public static ILogger getInstance(String pName)
ILogger
instance, using the factory's
current set of configuration attributes.
pName
- the name for which a logger should be returned/created
RuntimeException
- if the log factory was not initializedpublic static void setLevel(Class pClass, ILogger.LogLevel pLevel)
pClass
- the classpLevel
- the log levelpublic static void setLevel(String pName, ILogger.LogLevel pLevel)
pName
- the logger namepLevel
- the log levelpublic static ILogger.LogLevel getLevel(Class pClass)
pClass
- the class
public static ILogger.LogLevel getLevel(String pName)
pName
- the logger name
public static List<ILogger> getLogger()
ILogger
s
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |