Package com.atlassian.bamboo.specs.util
Class Logger
java.lang.Object
com.atlassian.bamboo.specs.util.Logger
Simple utility for logging to
System.out
at various log levels. Logging level is controlled by a system
property LOG_LEVEL_PROPERTY
.- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of system property which will indicate if date should be hidden in the log.static final Logger.LogLevel
Current log level.static final String
Name of system property which will indicate logging level. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Logs the givenmessage
atLogger.LogLevel.DEBUG
level.void
Logs the giventhrowable
atLogger.LogLevel.DEBUG
level.void
static @NotNull Logger
Returns an instance of the logger for the givenclass
.void
Logs the givenmessage
atLogger.LogLevel.INFO
level.void
Logs the giventhrowable
atLogger.LogLevel.INFO
level.void
boolean
Returns true if logging atLogger.LogLevel.DEBUG
is enabled.boolean
Returns true if logging atLogger.LogLevel.INFO
is enabled.boolean
Returns true if logging atLogger.LogLevel.TRACE
is enabled.void
log
(@NotNull Logger.LogLevel logLevel, @NotNull String message, @NotNull Object... args) Logs the givenmessage
atlogLevel
.void
log
(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable) Logs the giventhrowable
atlogLevel
level.void
log
(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable, @NotNull String message, @NotNull Object... args) Logs the giventhrowable
andmessage
atlogLevel
.void
Logs the givenmessage
atLogger.LogLevel.TRACE
level.void
Logs the giventhrowable
atLogger.LogLevel.TRACE
level.void
-
Field Details
-
LOG_LEVEL_PROPERTY
Name of system property which will indicate logging level. The value should be set to one of the values ofLogger.LogLevel
enum (case insensitive).Usage example:
java -Dbamboo.specs.log.level=DEBUG ...
- See Also:
-
LOG_HIDE_DATE
Name of system property which will indicate if date should be hidden in the log. Default is false.Usage example:
java -Dbamboo.specs.log.hideDate=true ...
- See Also:
-
LOG_LEVEL
Current log level.
-
-
Method Details
-
getLogger
Returns an instance of the logger for the givenclass
. -
info
Logs the givenmessage
atLogger.LogLevel.INFO
level. The message is formatted usingString.format(String, Object...)
. -
info
Logs the giventhrowable
atLogger.LogLevel.INFO
level. -
info
public void info(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowable
andmessage
atLogger.LogLevel.INFO
level. The message is formatted usingString.format(String, Object...)
. -
debug
Logs the givenmessage
atLogger.LogLevel.DEBUG
level. The message is formatted usingString.format(String, Object...)
. -
debug
Logs the giventhrowable
atLogger.LogLevel.DEBUG
level. -
debug
public void debug(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowable
andmessage
atLogger.LogLevel.DEBUG
level. The message is formatted usingString.format(String, Object...)
. -
trace
Logs the givenmessage
atLogger.LogLevel.TRACE
level. The message is formatted usingString.format(String, Object...)
. -
trace
Logs the giventhrowable
atLogger.LogLevel.TRACE
level. -
trace
public void trace(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowable
andmessage
atLogger.LogLevel.TRACE
level. The message is formatted usingString.format(String, Object...)
. -
log
public void log(@NotNull @NotNull Logger.LogLevel logLevel, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the givenmessage
atlogLevel
. The message is formatted usingString.format(String, Object...)
. -
log
Logs the giventhrowable
atlogLevel
level. -
log
public void log(@NotNull @NotNull Logger.LogLevel logLevel, @NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowable
andmessage
atlogLevel
. The message is formatted usingString.format(String, Object...)
. -
isInfoEnabled
public boolean isInfoEnabled()Returns true if logging atLogger.LogLevel.INFO
is enabled. -
isDebugEnabled
public boolean isDebugEnabled()Returns true if logging atLogger.LogLevel.DEBUG
is enabled. -
isTraceEnabled
public boolean isTraceEnabled()Returns true if logging atLogger.LogLevel.TRACE
is enabled.
-