Package io.airlift.log
Class Logger
java.lang.Object
io.airlift.log.Logger
-
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a message at DEBUG level.voidLogs a message at DEBUG level.voidLogs a message at DEBUG level.voidLogs a message at DEBUG level.voidLogs a message at ERROR level.voidLogs a message at ERROR level.voidLogs a message at ERROR level.voidLogs a message at ERROR level.voidLogs a message at ERROR level.static LoggerGets a logger named after a class' fully qualified name.static LoggerGets a named loggervoidLogs a message at INFO level.voidLogs a message at INFO level.booleanbooleanvoidLogs a message at WARN level.voidLogs a message at WARN level.voidLogs a message at WARN level.voidLogs a message at WARN level.
-
Method Details
-
get
Gets a logger named after a class' fully qualified name.- Parameters:
clazz- the class- Returns:
- the named logger
-
get
Gets a named logger- Parameters:
name- the name of the logger- Returns:
- the named logger
-
debug
Logs a message at DEBUG level.- Parameters:
exception- an exception associated with the debug message being loggedmessage- a literal message to log
-
debug
Logs a message at DEBUG level.- Parameters:
message- a literal message to log
-
debug
Logs a message at DEBUG level.Usage example:
logger.debug("value is %s (%d ms)", value, time);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
format- a format string compatible with String.format()args- arguments for the format string
-
debug
Logs a message at DEBUG level.Usage example:
logger.debug(e, "value is %s (%d ms)", value, time);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
exception- an exception associated with the debug message being loggedformat- a format string compatible with String.format()args- arguments for the format string
-
info
Logs a message at INFO level.- Parameters:
message- a literal message to log
-
info
Logs a message at INFO level.Usage example:
logger.info("value is %s (%d ms)", value, time);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
format- a format string compatible with String.format()args- arguments for the format string
-
warn
Logs a message at WARN level.- Parameters:
exception- an exception associated with the warning being loggedmessage- a literal message to log
-
warn
Logs a message at WARN level.- Parameters:
message- a literal message to log
-
warn
Logs a message at WARN level.Usage example:
logger.warn(e, "something bad happened when connecting to %s:%d", host, port);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
exception- an exception associated with the warning being loggedformat- a format string compatible with String.format()args- arguments for the format string
-
warn
Logs a message at WARN level.Usage example:
logger.warn("something bad happened when connecting to %s:%d", host, port);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
format- a format string compatible with String.format()args- arguments for the format string
-
error
Logs a message at ERROR level.- Parameters:
exception- an exception associated with the error being loggedmessage- a literal message to log
-
error
Logs a message at ERROR level.- Parameters:
message- a literal message to log
-
error
Logs a message at ERROR level.Usage example:
logger.error(e, "something really bad happened when connecting to %s:%d", host, port);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
exception- an exception associated with the error being loggedformat- a format string compatible with String.format()args- arguments for the format string
-
error
Logs a message at ERROR level. The value ofexception.getMessage()will be used as the log message.Usage example:
logger.error(e);- Parameters:
exception- an exception associated with the error being logged
-
error
Logs a message at ERROR level.Usage example:
logger.error("something really bad happened when connecting to %s:%d", host, port);If the format string is invalid or the arguments are insufficient, an error will be logged and execution will continue.- Parameters:
format- a format string compatible with String.format()args- arguments for the format string
-
isDebugEnabled
public boolean isDebugEnabled() -
isInfoEnabled
public boolean isInfoEnabled()
-