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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of system property which will indicate if date should be hidden in the log.static final Logger.LogLevelCurrent log level.static final StringName of system property which will indicate logging level. -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs the givenmessageatLogger.LogLevel.DEBUGlevel.voidLogs the giventhrowableatLogger.LogLevel.DEBUGlevel.voidstatic @NotNull LoggerReturns an instance of the logger for the givenclass.voidLogs the givenmessageatLogger.LogLevel.INFOlevel.voidLogs the giventhrowableatLogger.LogLevel.INFOlevel.voidbooleanReturns true if logging atLogger.LogLevel.DEBUGis enabled.booleanReturns true if logging atLogger.LogLevel.INFOis enabled.booleanReturns true if logging atLogger.LogLevel.TRACEis enabled.voidlog(@NotNull Logger.LogLevel logLevel, @NotNull String message, @NotNull Object... args) Logs the givenmessageatlogLevel.voidlog(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable) Logs the giventhrowableatlogLevellevel.voidlog(@NotNull Logger.LogLevel logLevel, @NotNull Throwable throwable, @NotNull String message, @NotNull Object... args) Logs the giventhrowableandmessageatlogLevel.voidLogs the givenmessageatLogger.LogLevel.TRACElevel.voidLogs the giventhrowableatLogger.LogLevel.TRACElevel.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.LogLevelenum (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 givenmessageatLogger.LogLevel.INFOlevel. The message is formatted usingString.format(String, Object...). -
info
Logs the giventhrowableatLogger.LogLevel.INFOlevel. -
info
public void info(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowableandmessageatLogger.LogLevel.INFOlevel. The message is formatted usingString.format(String, Object...). -
debug
Logs the givenmessageatLogger.LogLevel.DEBUGlevel. The message is formatted usingString.format(String, Object...). -
debug
Logs the giventhrowableatLogger.LogLevel.DEBUGlevel. -
debug
public void debug(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowableandmessageatLogger.LogLevel.DEBUGlevel. The message is formatted usingString.format(String, Object...). -
trace
Logs the givenmessageatLogger.LogLevel.TRACElevel. The message is formatted usingString.format(String, Object...). -
trace
Logs the giventhrowableatLogger.LogLevel.TRACElevel. -
trace
public void trace(@NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowableandmessageatLogger.LogLevel.TRACElevel. 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 givenmessageatlogLevel. The message is formatted usingString.format(String, Object...). -
log
Logs the giventhrowableatlogLevellevel. -
log
public void log(@NotNull @NotNull Logger.LogLevel logLevel, @NotNull @NotNull Throwable throwable, @NotNull @NotNull String message, @NotNull @NotNull Object... args) Logs the giventhrowableandmessageatlogLevel. The message is formatted usingString.format(String, Object...). -
isInfoEnabled
public boolean isInfoEnabled()Returns true if logging atLogger.LogLevel.INFOis enabled. -
isDebugEnabled
public boolean isDebugEnabled()Returns true if logging atLogger.LogLevel.DEBUGis enabled. -
isTraceEnabled
public boolean isTraceEnabled()Returns true if logging atLogger.LogLevel.TRACEis enabled.
-