public abstract class XBLogger extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG |
static int |
ERROR |
static int |
FATAL |
static int |
INFO |
protected static String[] |
LEVEL_STRINGS
Long strings for numeric log level.
|
protected static String[] |
LEVEL_STRINGS_SHORT
Short strings for numeric log level.
|
static int |
WARN |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_log(int level,
Object obj1)
Log a message
|
protected abstract void |
_log(int level,
Object obj1,
Throwable exception)
Log a message
|
abstract boolean |
check(int level)
Check if a logger is enabled to log at the specified level
This allows code to avoid building strings or evaluating functions in
the arguments to log.
|
abstract void |
initialize(String cat) |
void |
log(int level,
Object... objs)
Log a message.
|
public static final int DEBUG
public static final int INFO
public static final int WARN
public static final int ERROR
public static final int FATAL
protected static final String[] LEVEL_STRINGS_SHORT
protected static final String[] LEVEL_STRINGS
public abstract void initialize(String cat)
protected abstract void _log(int level, Object obj1)
level
- One of DEBUG, INFO, WARN, ERROR, FATALobj1
- The object to log. This is converted to a string.protected abstract void _log(int level, Object obj1, Throwable exception)
level
- One of DEBUG, INFO, WARN, ERROR, FATALobj1
- The object to log. This is converted to a string.exception
- An exception to be loggedpublic abstract boolean check(int level)
if (logger.check(XBLogger.INFO)) {
logger.log(XBLogger.INFO, "Avoid concatenating " + " strings and evaluating " + functions());
}
level
- One of DEBUG, INFO, WARN, ERROR, FATAL