|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlog2.LoggerHandler
public class LoggerHandler
This class handles logging operations.
Field Summary | |
---|---|
static java.lang.String |
ALL
Indicates all logging levels |
static java.lang.String |
ERROR
The error log level |
static java.lang.String |
INFO
The info log level |
static java.lang.String |
MESSAGE
The message log level - always output to stdout and any others |
static java.lang.String |
SEVERE
The severe log level |
static java.lang.Object |
syncOn
An object to synchronize on |
static java.lang.String |
WARN
The warn log level |
Constructor Summary | |
---|---|
LoggerHandler()
Creates a new instance of LoggerHandler. |
Method Summary | |
---|---|
static void |
addDebugChannel(java.lang.String channelType,
LogChannel logChannel)
Add a new debugging channel. |
static void |
addLogChannel(java.lang.String channelType,
LogChannel logChannel)
Add a new logging channel. |
static void |
debugError(Logger logger,
java.lang.String level,
java.lang.Exception error)
Log the error on the debug log stream. |
static void |
debugMessage(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Log the message on the debug stream if suitable. |
static Logger |
getLogger(java.lang.String loggerID)
Return a logger appropriate to the class specified. |
static java.util.Vector |
getLogLevels()
Get a list of all possible logging levels. |
static boolean |
levelOK(java.lang.String theLevel,
java.lang.String logLevel)
Return true if the level to log at is higher or equal to the configuration level. |
static void |
logError(Logger logger,
java.lang.String level,
java.lang.Exception error)
Log the error on the log stream. |
static void |
logMessage(Logger logger,
java.lang.String level,
java.lang.String methodName,
java.lang.String message)
Log the message on the logger if suitable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ALL
public static final java.lang.String INFO
public static final java.lang.String WARN
public static final java.lang.String ERROR
public static final java.lang.String SEVERE
public static final java.lang.String MESSAGE
public static final java.lang.Object syncOn
Constructor Detail |
---|
public LoggerHandler() throws java.lang.Exception
java.lang.Exception
- any error.Method Detail |
---|
public static Logger getLogger(java.lang.String loggerID)
loggerID
- the id used to identify the logger.
public static void addLogChannel(java.lang.String channelType, LogChannel logChannel)
channelType
- the channel type. Can be LogConst
.STDOUTID
,
STDERRID
or STDFILEID
.logChannel
- the channel to add, of the appropriate type.public static void addDebugChannel(java.lang.String channelType, LogChannel logChannel)
channelType
- the channel type. Can be LogConst
.STDOUTID
,
STDERRID
or STDFILEID
.logChannel
- the channel to add, of the appropriate type.public static boolean levelOK(java.lang.String theLevel, java.lang.String logLevel)
theLevel
- the level the error or log message is at.logLevel
- the level the configuration is set to log to.
public static void logMessage(Logger logger, java.lang.String level, java.lang.String methodName, java.lang.String message)
logger
- the logger to write to.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- the message to log.public static void debugMessage(Logger logger, java.lang.String level, java.lang.String methodName, java.lang.String message)
logger
- the logger to write to.level
- the error level.methodName
- the name of the method in the class throwing the exception.message
- the message to log.public static void logError(Logger logger, java.lang.String level, java.lang.Exception error)
logger
- the logger to write to.level
- the error level.error
- the error to log.public static void debugError(Logger logger, java.lang.String level, java.lang.Exception error)
logger
- the logger to write to.level
- the error level.error
- the error to log.public static java.util.Vector getLogLevels()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |