@InterfaceAudience.Public @InterfaceStability.Evolving public class NoLogger extends Object implements Log
VarraProperties.setProperty(java.lang.String, java.lang.Object)(
LoggerConstants.LOG_CLASS_FQ_NAME,
Log4jLogger[ConsoleLogger].class.getName()| Constructor and Description |
|---|
NoLogger()
Instantiates a new no 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.
|
static NoLogger |
getNoLogger()
Gets the no 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 |
shutdown(ShutdownMode mode)
Shutdowns this entity properly by performing all the necessary steps to
make sure that all the used resources are released properly based on the
ShutdownMode specified. |
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)
|
public static NoLogger getNoLogger()
public void trace(Object message)
LogTRACE level.public void trace(Object message, Throwable t)
LogTRACE level including
the stack trace of the Throwablet passed as
parameter.
See Log.debug(Object) form for more detailed information.
public void info(Object message)
LogINFO Level.public void info(Object message, Throwable t)
LogINFO level including the
stack trace of the Throwable t passed as parameter.
See Log.info(Object) for more detailed information.
public void debug(Object message)
LogDEBUG level.public void debug(Object message, Throwable t)
LogDEBUG level including
the stack trace of the Throwable t passed as
parameter.debug in interface Logmessage - the messaget - the tLog.debug(java.lang.Object)public void warn(Object message)
LogWARN Level.public void warn(Object message, Throwable t)
Logwarn in interface Logmessage - the messaget - the tfor more detailed information.public void error(Object message)
LogERROR Level..public void error(Object message, Throwable t)
LogERROR level including the
stack trace of the Throwable t passed as parameter.error in interface Logmessage - the messaget - the tform for more detailed information.public void fatal(Object message)
LogFATAL Level.public void fatal(Object message, Throwable t)
LogFATAL level including
the stack trace of the Throwable t passed as
parameter.fatal in interface Logmessage - the messaget - the tfor more detailed information.public void test(Object message)
LogDEBUG and
INFO are not adequate.public void test(Object message, Throwable t)
LogThrowable t passed as parameter.test in interface Logmessage - the messaget - the tfor more detailed information.public void log(Object message, int level, String levelString)
LogMyLevel (an user
defined) Level. public void log(Object message, Throwable t)
LogMyLevel (an user
defined) Level Throwable t passed
as parameter.log in interface Logmessage - the messaget - the tfor more detailed information.public boolean isDebugEnabled()
LogDEBUG 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.
isDebugEnabled in interface Logtrue if this category is debug enabled,
false otherwise.public boolean isInfoEnabled()
LogLog.isDebugEnabled().isInfoEnabled in interface Logtrue if this category is enabled for level
info, false otherwise.public void setLevel(MyLogLevel level)
LogMyLogLevel.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.
public MyLogLevel getLevel()
LogMyLogLevel, if any, for this Category.public void shutdown(ShutdownMode mode)
ShutdownableShutdownMode specified.shutdown in interface Shutdownablemode - the modeCopyright © 2016 utils4j. All Rights Reserved.