Class Logger
-
- All Implemented Interfaces:
@Deprecated() public abstract class Logger
The object interacted with by client objects to perform logging.
Peter Donald
-
-
Field Summary
Fields Modifier and Type Field Description public final static charCATEGORY_SEPARATOR
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
Modifier and Type Method Description abstract booleanisDebugEnabled()Determine if messages of priority DEBUG will be logged. abstract voiddebug(String message, Throwable throwable)Log a debug priority event. abstract voiddebug(String message)Log a debug priority event. abstract booleanisInfoEnabled()Determine if messages of priority INFO will be logged. abstract voidinfo(String message, Throwable throwable)Log a info priority event. abstract voidinfo(String message)Log a info priority event. abstract booleanisWarnEnabled()Determine if messages of priority WARN will be logged. abstract voidwarn(String message, Throwable throwable)Log a warn priority event. abstract voidwarn(String message)Log a warn priority event. abstract booleanisErrorEnabled()Determine if messages of priority ERROR will be logged. abstract voiderror(String message, Throwable throwable)Log a error priority event. abstract voiderror(String message)Log a error priority event. abstract booleanisFatalErrorEnabled()Determine if messages of priority FATAL_ERROR will be logged. abstract voidfatalError(String message, Throwable throwable)Log a fatalError priority event. abstract voidfatalError(String message)Log a fatalError priority event. voidsetAdditivity(boolean additivity)Make this logger additive. abstract booleanisPriorityEnabled(Priority priority)Determine if messages of priority will be logged. abstract voidlog(Priority priority, String message, Throwable throwable)Log a event at specific priority with a certain message and throwable. abstract voidlog(Priority priority, String message)Log a event at specific priority with a certain message. voidsetPriority(Priority priority)Set the priority for this logger. voidunsetPriority()Unset the priority of Logger. voidunsetPriority(boolean recursive)Unset the priority of Logger. voidsetLogTargets(Array<LogTarget> logTargets)Set the log targets for this logger. voidunsetLogTargets()Unset the logtargets for this logger. voidunsetLogTargets(boolean recursive)Unset the logtargets for this logger and all child loggers if recursive is set. Array<Logger>getChildren()Get all the child Loggers of current logger. abstract LoggergetChildLogger(String subCategory)Create a new child logger. -
-
Method Detail
-
isDebugEnabled
abstract boolean isDebugEnabled()
Determine if messages of priority DEBUG will be logged.
- Returns:
true if DEBUG messages will be logged
-
debug
abstract void debug(String message, Throwable throwable)
Log a debug priority event.
- Parameters:
message- the messagethrowable- the throwable
-
debug
abstract void debug(String message)
Log a debug priority event.
- Parameters:
message- the message
-
isInfoEnabled
abstract boolean isInfoEnabled()
Determine if messages of priority INFO will be logged.
- Returns:
true if INFO messages will be logged
-
info
abstract void info(String message, Throwable throwable)
Log a info priority event.
- Parameters:
message- the messagethrowable- the throwable
-
info
abstract void info(String message)
Log a info priority event.
- Parameters:
message- the message
-
isWarnEnabled
abstract boolean isWarnEnabled()
Determine if messages of priority WARN will be logged.
- Returns:
true if WARN messages will be logged
-
warn
abstract void warn(String message, Throwable throwable)
Log a warn priority event.
- Parameters:
message- the messagethrowable- the throwable
-
warn
abstract void warn(String message)
Log a warn priority event.
- Parameters:
message- the message
-
isErrorEnabled
abstract boolean isErrorEnabled()
Determine if messages of priority ERROR will be logged.
- Returns:
true if ERROR messages will be logged
-
error
abstract void error(String message, Throwable throwable)
Log a error priority event.
- Parameters:
message- the messagethrowable- the throwable
-
error
abstract void error(String message)
Log a error priority event.
- Parameters:
message- the message
-
isFatalErrorEnabled
abstract boolean isFatalErrorEnabled()
Determine if messages of priority FATAL_ERROR will be logged.
- Returns:
true if FATAL_ERROR messages will be logged
-
fatalError
abstract void fatalError(String message, Throwable throwable)
Log a fatalError priority event.
- Parameters:
message- the messagethrowable- the throwable
-
fatalError
abstract void fatalError(String message)
Log a fatalError priority event.
- Parameters:
message- the message
-
setAdditivity
@Deprecated() void setAdditivity(boolean additivity)
Make this logger additive. I.e. Send all log events to parent loggers LogTargets regardless of whether or not the LogTargets have been overridden. This is derived from Log4js notion of Additivity.
- Parameters:
additivity- true to make logger additive, false otherwise
-
isPriorityEnabled
abstract boolean isPriorityEnabled(Priority priority)
Determine if messages of priority will be logged.
- Parameters:
priority- the priority- Returns:
true if messages will be logged
-
log
abstract void log(Priority priority, String message, Throwable throwable)
Log a event at specific priority with a certain message and throwable.
- Parameters:
priority- the prioritymessage- the messagethrowable- the throwable
-
log
abstract void log(Priority priority, String message)
Log a event at specific priority with a certain message.
- Parameters:
priority- the prioritymessage- the message
-
setPriority
@Deprecated() void setPriority(Priority priority)
Set the priority for this logger.
- Parameters:
priority- the priority
-
unsetPriority
@Deprecated() void unsetPriority()
Unset the priority of Logger. (Thus it will use it's parent's priority or DEBUG if no parent.
-
unsetPriority
@Deprecated() void unsetPriority(boolean recursive)
Unset the priority of Logger. (Thus it will use it's parent's priority or DEBUG if no parent. If recursive is true unset priorities of all child loggers.
- Parameters:
recursive- true to unset priority of all child loggers
-
setLogTargets
@Deprecated() void setLogTargets(Array<LogTarget> logTargets)
Set the log targets for this logger.
- Parameters:
logTargets- the Log Targets
-
unsetLogTargets
@Deprecated() void unsetLogTargets()
Unset the logtargets for this logger. This logger (and thus all child loggers who don't specify logtargets) will inherit from the parents LogTargets.
-
unsetLogTargets
@Deprecated() void unsetLogTargets(boolean recursive)
Unset the logtargets for this logger and all child loggers if recursive is set. The loggers unset (and all child loggers who don't specify logtargets) will inherit from the parents LogTargets.
- Parameters:
recursive- the recursion policy
-
getChildren
@Deprecated() Array<Logger> getChildren()
Get all the child Loggers of current logger.
- Returns:
the child loggers
-
getChildLogger
abstract Logger getChildLogger(String subCategory)
Create a new child logger. The category of child logger is [current-category].subcategory
- Parameters:
subCategory- the subcategory of this logger- Returns:
the new logger
-
-
-
-