@InterfaceAudience.Public @InterfaceStability.Evolving public interface Log extends Shutdownable
Logger| Modifier and Type | Method and Description |
|---|---|
void |
debug(Object message)
Log a message object with the
DEBUG level. |
void |
debug(Object message,
Throwable t)
Log a message object with the
DEBUG level including
the stack trace of the Throwable t passed as
parameter. |
void |
error(Object message)
Log a message object with the
ERROR Level.. |
void |
error(Object message,
Throwable t)
Log a message object with the
ERROR level including the
stack trace of the Throwable t passed as parameter. |
void |
fatal(Object message)
Log a message object with the
FATAL Level. |
void |
fatal(Object message,
Throwable t)
Log a message object with the
FATAL level including
the stack trace of the Throwable t passed as
parameter. |
MyLogLevel |
getLevel()
Returns the assigned
MyLogLevel, if any, for this Category. |
String |
getName()
Gets the name of the logger.
|
void |
info(Object message)
Log a message object with the
INFO Level. |
void |
info(Object message,
Throwable t)
Log a message object with the
INFO level including the
stack trace of the Throwable t passed as parameter. |
boolean |
isDebugEnabled()
Check whether this category is enabled for the
DEBUG Level. |
boolean |
isInfoEnabled()
Check whether this category is enabled for the info Level.
|
void |
log(Object message,
int level,
String levelString)
Log a message object with the
MyLevel (an user
defined) Level. |
void |
log(Object message,
Throwable t)
Log a message object with the
MyLevel (an user
defined) Level including the stack trace of the Throwable t passed
as parameter. |
void |
setLevel(MyLogLevel level)
Set the level of this Category.
|
void |
setName(String name)
Sets the name.
|
void |
test(Object message)
Log a message object with the test Level.
|
void |
test(Object message,
Throwable t)
Log a message object with the test level including the
stack trace of the
Throwable t passed as parameter. |
void |
trace(Object message)
Log a message object with the
TRACE level. |
void |
trace(Object message,
Throwable t)
Log a message object with the
TRACE level including
the stack trace of the Throwablet passed as
parameter. |
void |
warn(Object message)
Log a message object with the
WARN Level. |
void |
warn(Object message,
Throwable t)
|
shutdownString getName()
void setName(String name)
name - the namevoid trace(Object message)
TRACE level.message - the messagevoid trace(Object message, Throwable t)
TRACE level including
the stack trace of the Throwablet passed as
parameter.
See debug(Object) form for more detailed information.
message - the messaget - the tvoid info(Object message)
INFO Level.message - the messagevoid info(Object message, Throwable t)
INFO level including the
stack trace of the Throwable t passed as parameter.
See info(Object) for more detailed information.
message - the messaget - the tvoid debug(Object message)
DEBUG level.message - the messagevoid debug(Object message, Throwable t)
DEBUG level including
the stack trace of the Throwable t passed as
parameter.message - the messaget - the tdebug(java.lang.Object)void warn(Object message)
WARN Level.message - the messagevoid warn(Object message, Throwable t)
message - the messaget - the tfor more detailed information.void error(Object message)
ERROR Level..message - the messagevoid error(Object message, Throwable t)
ERROR level including the
stack trace of the Throwable t passed as parameter.message - the messaget - the tform for more detailed information.void fatal(Object message)
FATAL Level.message - the messagevoid fatal(Object message, Throwable t)
FATAL level including
the stack trace of the Throwable t passed as
parameter.message - the messaget - the tfor more detailed information.void test(Object message)
DEBUG and
INFO are not adequate.message - the messagevoid test(Object message, Throwable t)
Throwable t passed as parameter.message - the messaget - the tfor more detailed information.void log(Object message, int level, String levelString)
MyLevel (an user
defined) Level. message - the messagelevel - the levellevelString - the level stringvoid log(Object message, Throwable t)
MyLevel (an user
defined) Level Throwable t passed
as parameter.message - the messaget - the tfor more detailed information.boolean isDebugEnabled()
DEBUG Level.
This function is intended to lessen the computational cost of disabled log debug statements.
For some cat Category object, when you write,
logger.debug("This is entry number: " + i);
You incur the cost constructing the message, concatenatiion in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should write
if (logger.isDebugEnabled())
{
logger.debug("This is entry number: " + i);
}
This way you will not incur the cost of parameter construction if
debugging is disabled for cat. On the other hand, if the
cat is debug enabled, you will incur the cost of evaluating
whether the category is debug enabled twice. Once in
isDebugEnabled and once in the debug. This is
an insignificant overhead since evaluating a category takes about 1%% of
the time it takes to actually log.
true if this category is debug enabled,
false otherwise.boolean isInfoEnabled()
isDebugEnabled().true if this category is enabled for level
info, false otherwise.void setLevel(MyLogLevel level)
MyLogLevel.DEBUG, MyLogLevel.INFO,
MyLogLevel.WARN, MyLogLevel.ERROR,
MyLogLevel.FATAL as a parameter, you need to case them as
MyLogLevel.
As in
logger.setLevel((MyLogLevel) MyLogLevel.DEBUG);
Null values are not entertained.
level - the new levelMyLogLevel getLevel()
MyLogLevel, if any, for this Category.null.
the levelCopyright © 2016 utils4j. All Rights Reserved.