public final class Logger extends Object
The logging will delegate to slf4j.
Level| Modifier and Type | Method and Description |
|---|---|
void |
debug(String msg)
Logs the specified message at the DEBUG level.
|
void |
error(String msg)
Logs the specified message at the ERROR level.
|
static Logger |
getLogger(Class<?> clazz)
Gets a logger with the specified class.
|
static Logger |
getLogger(String className)
Gets a logger with the specified class name.
|
void |
info(String msg)
Logs the specified message at the INFO level.
|
boolean |
isDebugEnabled()
Determines whether this logger enabled for DEBUG level.
|
boolean |
isErrorEnabled()
Determines whether this logger enabled for ERROR level.
|
boolean |
isInfoEnabled()
Determines whether this logger enabled for INFO level.
|
boolean |
isLoggable(Level level)
Checks if a message of the given level would actually be logged by this logger.
|
boolean |
isTraceEnabled()
Determines whether this logger enabled for TRACE level.
|
boolean |
isWarnEnabled()
Determines whether this logger enabled for WARN level.
|
void |
log(Level level,
String msg,
Object... args)
Logs the specified message with the specified logging level and arguments.
|
void |
log(Level level,
String msg,
Throwable throwable)
Logs the specified message with the specified logging level and throwable.
|
void |
trace(String msg)
Logs the specified message at the TRACE level.
|
void |
warn(String msg)
Logs the specified message at the WARN level.
|
public static Logger getLogger(String className)
className - the specified class namepublic static Logger getLogger(Class<?> clazz)
clazz - the specified classpublic void error(String msg)
msg - the specified messagepublic void warn(String msg)
msg - the specified messagepublic void info(String msg)
msg - the specified messagepublic void debug(String msg)
msg - the specified messagepublic void trace(String msg)
msg - the specified messagepublic void log(Level level, String msg, Throwable throwable)
level - the specified logging levelmsg - the specified messagethrowable - the specified throwablepublic void log(Level level, String msg, Object... args)
level - the specified logging levelmsg - the specified messageargs - the specified argumentspublic boolean isErrorEnabled()
true if it is enabled for ERROR level, return false otherwisepublic boolean isWarnEnabled()
true if it is enabled for WARN level, return false otherwisepublic boolean isInfoEnabled()
true if it is enabled for INFO level, return false otherwisepublic boolean isDebugEnabled()
true if it is enabled for DEBUG level, return false otherwisepublic boolean isTraceEnabled()
true if it is enabled for TRACE level, return false otherwisepublic boolean isLoggable(Level level)
level - the given leveltrue if it could, returns false if it couldn'tCopyright © 2009–2019 B3log. All rights reserved.