public final class Log extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Log.Level
Basic logging levels.
|
Modifier and Type | Field and Description |
---|---|
static String |
LOGSPI_PROP
System property to set the logger class that is most appropriate.
|
static String |
LOGSPI_PROPS_FILE
Filename 'connectors.properties' used to for SPI class in the
'$(java.home)/lib/' directory.
|
Modifier and Type | Method and Description |
---|---|
void |
error(String format,
Object... args) |
void |
error(Throwable ex,
String format,
Object... args) |
protected StackTraceElement |
extract(StackTraceElement[] steArray,
Collection<String> frameworkPackageList) |
static Log |
getLog(Class<?> clazz)
Get the logger for the particular class.
|
void |
info(String format,
Object... args) |
void |
info(Throwable ex,
String format,
Object... args) |
boolean |
isError() |
boolean |
isInfo() |
protected boolean |
isInFrameworkPackageList(String currentClass,
Collection<String> frameworkPackageList) |
boolean |
isLoggable(Log.Level level)
Determine if its log-able at this level within this class.
|
boolean |
isOk() |
boolean |
isWarning() |
void |
log(Class<?> clazz,
String method,
Log.Level level,
String message,
Throwable ex)
Lowest level logging method.
|
void |
log(Log.Level level,
Throwable ex,
String format,
Object... args)
Logs based on the parameters given.
|
protected void |
log(Log.Level level,
Throwable ex,
String message,
StackTraceElement[] locations) |
void |
ok(String format,
Object... args) |
void |
ok(Throwable ex,
String format,
Object... args) |
void |
warn(String format,
Object... args) |
void |
warn(Throwable ex,
String format,
Object... args) |
public static final String LOGSPI_PROP
public static final String LOGSPI_PROPS_FILE
public static Log getLog(Class<?> clazz)
private static final Log LOG = Log.getLog(MyClass.class);
clazz
- class to log information about.public boolean isLoggable(Log.Level level)
public void log(Class<?> clazz, String method, Log.Level level, String message, Throwable ex)
clazz
- Class that is being logged.method
- Method name that is being logged.level
- Logging level.message
- Message about the log.ex
- Exception to use process.public void log(Log.Level level, Throwable ex, String format, Object... args)
MessageFormat
.level
- the logging level at which to write the message.ex
- [optional] exception stack trace to log.format
- [optional] create a message of a particular format.args
- [optional] parameters to the format string.protected void log(Log.Level level, Throwable ex, String message, StackTraceElement[] locations)
protected StackTraceElement extract(StackTraceElement[] steArray, Collection<String> frameworkPackageList)
protected boolean isInFrameworkPackageList(String currentClass, Collection<String> frameworkPackageList)
public boolean isOk()
public boolean isInfo()
public boolean isWarning()
public boolean isError()
Copyright © 2022. All rights reserved.