public final class Logger extends Object
System.out
at various log levels. Logging level is controlled by a system
property LOG_LEVEL_PROPERTY
.LOG_LEVEL_PROPERTY
,
Logger.LogLevel
Modifier and Type | Class and Description |
---|---|
static class |
Logger.LogLevel
Available levels of logging.
|
Modifier and Type | Field and Description |
---|---|
static String |
LOG_HIDE_DATE
Name of system property which will indicate if date should be hidden in the log.
|
static Logger.LogLevel |
LOG_LEVEL
Current log level.
|
static String |
LOG_LEVEL_PROPERTY
Name of system property which will indicate logging level.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(String message,
Object... args)
Logs the given
message at Logger.LogLevel.DEBUG level. |
void |
debug(Throwable throwable)
Logs the given
throwable at Logger.LogLevel.DEBUG level. |
void |
debug(Throwable throwable,
String message,
Object... args)
|
static Logger |
getLogger(Class<?> forClass)
Returns an instance of the logger for the given
class . |
void |
info(String message,
Object... args)
Logs the given
message at Logger.LogLevel.INFO level. |
void |
info(Throwable throwable)
Logs the given
throwable at Logger.LogLevel.INFO level. |
void |
info(Throwable throwable,
String message,
Object... args)
|
boolean |
isDebugEnabled()
Returns true if logging at
Logger.LogLevel.DEBUG is enabled. |
boolean |
isInfoEnabled()
Returns true if logging at
Logger.LogLevel.INFO is enabled. |
boolean |
isTraceEnabled()
Returns true if logging at
Logger.LogLevel.TRACE is enabled. |
void |
log(Logger.LogLevel logLevel,
String message,
Object... args)
Logs the given
message at logLevel . |
void |
log(Logger.LogLevel logLevel,
Throwable throwable)
Logs the given
throwable at logLevel level. |
void |
log(Logger.LogLevel logLevel,
Throwable throwable,
String message,
Object... args)
Logs the given
throwable and message at logLevel . |
void |
trace(String message,
Object... args)
Logs the given
message at Logger.LogLevel.TRACE level. |
void |
trace(Throwable throwable)
Logs the given
throwable at Logger.LogLevel.TRACE level. |
void |
trace(Throwable throwable,
String message,
Object... args)
|
public static final String LOG_LEVEL_PROPERTY
Logger.LogLevel
enum (case insensitive).
Usage example:
java -Dbamboo.specs.log.level=DEBUG ...
public static final String LOG_HIDE_DATE
Usage example:
java -Dbamboo.specs.log.hideDate=true ...
public static final Logger.LogLevel LOG_LEVEL
@NotNull public static Logger getLogger(@NotNull Class<?> forClass)
class
.public void info(@NotNull String message, @NotNull Object... args)
message
at Logger.LogLevel.INFO
level. The message is formatted using
String.format(String, Object...)
.public void info(@NotNull Throwable throwable)
throwable
at Logger.LogLevel.INFO
level.public void info(@NotNull Throwable throwable, @NotNull String message, @NotNull Object... args)
throwable
and message
at Logger.LogLevel.INFO
level. The message is formatted
using String.format(String, Object...)
.public void debug(@NotNull String message, @NotNull Object... args)
message
at Logger.LogLevel.DEBUG
level. The message is formatted using
String.format(String, Object...)
.public void debug(@NotNull Throwable throwable)
throwable
at Logger.LogLevel.DEBUG
level.public void debug(@NotNull Throwable throwable, @NotNull String message, @NotNull Object... args)
throwable
and message
at Logger.LogLevel.DEBUG
level. The message is formatted
using String.format(String, Object...)
.public void trace(@NotNull String message, @NotNull Object... args)
message
at Logger.LogLevel.TRACE
level. The message is formatted using
String.format(String, Object...)
.public void trace(@NotNull Throwable throwable)
throwable
at Logger.LogLevel.TRACE
level.public void trace(@NotNull Throwable throwable, @NotNull String message, @NotNull Object... args)
throwable
and message
at Logger.LogLevel.TRACE
level. The message is formatted
using String.format(String, Object...)
.public void log(@NotNull Logger.LogLevel logLevel, @NotNull String message, @NotNull Object... args)
message
at logLevel
. The message is formatted using
String.format(String, Object...)
.public void log(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable)
throwable
at logLevel
level.public void log(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable, @NotNull String message, @NotNull Object... args)
throwable
and message
at logLevel
. The message is formatted
using String.format(String, Object...)
.public boolean isInfoEnabled()
Logger.LogLevel.INFO
is enabled.public boolean isDebugEnabled()
Logger.LogLevel.DEBUG
is enabled.public boolean isTraceEnabled()
Logger.LogLevel.TRACE
is enabled.Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.