public class CILogger
extends java.lang.Object
CiacLogger uses the following logging levels, from highest to lowest:
The isLEVEL() methods are included to improve performance. Before calling one of the logging methods with parameters that would require string concatenation, object creation, or other expensive operations, the corresponding isLEVEL() call can be made first. For example:
In the code sample above, calling isDebug() prevents the string concatenation from occuring when the Debug level is not enabled, thus improving performance.if (log.isDebug()) { log.debug(CLASSNAME, METHOD, "Value " + value + " for key " + key + " is within range."); }
Constructor and Description |
---|
CILogger(MXLogger logger)
Creates an CiacLogger from an MXLogger
|
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.String className,
java.lang.String method,
java.lang.String msg)
Writes a message to the log at Debug level.
|
void |
debug(java.lang.String className,
java.lang.String method,
java.lang.String msg,
java.lang.Throwable t)
Writes a message to the log at Debug level, along with a Throwable.
|
void |
debugEntry(java.lang.String className,
java.lang.String method)
Logs the entry to a method that has no input parameters.
|
void |
debugEntry(java.lang.String className,
java.lang.String method,
java.lang.Object param1)
Logs the entry to a method that has one input parameter.
|
void |
debugEntry(java.lang.String className,
java.lang.String method,
java.lang.Object[] params)
Writes a message to the log at Debug level indicating that a new method
has just been entered.
|
void |
debugEntry(java.lang.String className,
java.lang.String method,
java.lang.Object param1,
java.lang.Object param2)
Logs the entry to a method that has two input parameters.
|
void |
debugEntry(java.lang.String className,
java.lang.String method,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
Logs the entry to a method that has three input parameters.
|
void |
debugEntry(java.lang.String className,
java.lang.String method,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3,
java.lang.Object param4)
Logs the entry to a method that has four input parameters.
|
void |
debugExit(java.lang.String className,
java.lang.String method)
Writes a message to the log at Debug level indicating the normal exit point
of a method that returns void.
|
void |
debugExit(java.lang.String className,
java.lang.String method,
java.lang.Object returnValue)
Writes a message to the log at Debug level indicating the normal exit point of a method that
returns a value.
|
void |
error(java.lang.String className,
java.lang.String method,
java.lang.String msg)
Writes a message to the log at Error level.
|
void |
error(java.lang.String className,
java.lang.String method,
java.lang.String msg,
java.lang.Throwable t)
Writes a message to the log at Error level, along with a Throwable.
|
void |
fatal(java.lang.String className,
java.lang.String method,
java.lang.String msg)
Writes a message to the log at Fatal level.
|
void |
fatal(java.lang.String className,
java.lang.String method,
java.lang.String msg,
java.lang.Throwable t)
Writes a message to the log at Fatal level, along with a Throwable.
|
void |
info(java.lang.String className,
java.lang.String method,
java.lang.String msg)
Writes a message to the log at Info level.
|
void |
info(java.lang.String className,
java.lang.String method,
java.lang.String msg,
java.lang.Throwable t)
Writes a message to the log at Info level, along with a Throwable.
|
boolean |
isDebug()
Indicates whether the Debug level is enabled.
|
boolean |
isError()
Indicates whether the Error level is enabled.
|
boolean |
isInfo()
Indicates whether the Info level is enabled.
|
boolean |
isWarn()
Indicates whether the Warn level is enabled.
|
void |
warn(java.lang.String className,
java.lang.String method,
java.lang.String msg)
Writes a message to the log at Warn level.
|
void |
warn(java.lang.String className,
java.lang.String method,
java.lang.String msg,
java.lang.Throwable t)
Writes a message to the log at Warn level, along with a Throwable.
|
public CILogger(MXLogger logger)
public boolean isDebug()
true
if Debug and higher levels are enabled; false
otherwisepublic boolean isInfo()
true
if Info and higher levels are enabled; false
otherwisepublic boolean isWarn()
true
if Warn and higher levels are enabled; false
otherwisepublic boolean isError()
true
if Error and higher levels are enabled; false
otherwisepublic void debug(java.lang.String className, java.lang.String method, java.lang.String msg)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logpublic void debug(java.lang.String className, java.lang.String method, java.lang.String msg, java.lang.Throwable t)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logt
- a Throwable related to the messagepublic void info(java.lang.String className, java.lang.String method, java.lang.String msg)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logpublic void info(java.lang.String className, java.lang.String method, java.lang.String msg, java.lang.Throwable t)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logt
- a Throwable related to the messagepublic void warn(java.lang.String className, java.lang.String method, java.lang.String msg)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logpublic void warn(java.lang.String className, java.lang.String method, java.lang.String msg, java.lang.Throwable t)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logt
- a Throwable related to the messagepublic void error(java.lang.String className, java.lang.String method, java.lang.String msg)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logpublic void error(java.lang.String className, java.lang.String method, java.lang.String msg, java.lang.Throwable t)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logt
- a Throwable related to the messagepublic void fatal(java.lang.String className, java.lang.String method, java.lang.String msg)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logpublic void fatal(java.lang.String className, java.lang.String method, java.lang.String msg, java.lang.Throwable t)
className
- the name of the class that contains this callmethod
- the name of the method that contains this callmsg
- the message to be written to the logt
- a Throwable related to the messagepublic void debugEntry(java.lang.String className, java.lang.String method, java.lang.Object[] params)
This is the most general purpose of the debugEntry() methods. In practice, this method is only necessary for methods that take more than four parameters, as there are convenience methods for use with methods that take four or fewer params. The convenience methods will also give better performance.
className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredparams
- an array of the parameters to the method being entered. May be null or empty.public void debugEntry(java.lang.String className, java.lang.String method)
debugEntry(String,String,Object[])
.className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredpublic void debugEntry(java.lang.String className, java.lang.String method, java.lang.Object param1)
debugEntry(String,String,Object[])
.className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredparam1
- the first parameter of the method being entered.public void debugEntry(java.lang.String className, java.lang.String method, java.lang.Object param1, java.lang.Object param2)
debugEntry(String,String,Object[])
.className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredparam1
- the first parameter of the method being entered.param2
- the second parameter of the method being entered.public void debugEntry(java.lang.String className, java.lang.String method, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
debugEntry(String,String,Object[])
.className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredparam1
- the first parameter of the method being entered.param2
- the second parameter of the method being entered.param3
- the third parameter of the method being entered.public void debugEntry(java.lang.String className, java.lang.String method, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4)
debugEntry(String,String,Object[])
.className
- the name of the class containing the method that is being enteredmethod
- the name of the method that is being enteredparam1
- the first parameter of the method being entered.param2
- the second parameter of the method being entered.param3
- the third parameter of the method being entered.param4
- the fourth parameter of the method being entered.public void debugExit(java.lang.String className, java.lang.String method, java.lang.Object returnValue)
return
line.
NOTE: This method should be used for normal exit only (before a return statement),
and NOT before a throw
statement. If there are multiple return statements
in a method, this method should be called before each one.
For methods that return void, use debugExit(String,String)
instead. This will make it
possible to distinguish in the log between methods returning null and methods
that return void.
className
- the name of the class containing the method that is being exitedmethod
- the name of the method that is being exitedreturnValue
- the value being returned by the method being exitedpublic void debugExit(java.lang.String className, java.lang.String method)
NOTE: This method should be used for normal exit only (before a return statement or
at the bottom of the method), and NOT before a throw
statement.
If there are multiple return statements, this method should be called just before each
one, as well as at the bottom of the method.
For methods that return a value, even if it is null, use debugExit(String,String,Object)
instead.
This will make it possible to distinguish in the log between methods returning null and methods
that return void.
className
- the name of the class containing the method that is being exitedmethod
- the name of the method that is being exited