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(@NotNull String message,
Object... args)
Logs the given
message at Logger.LogLevel.DEBUG level. |
void |
debug(@NotNull Throwable throwable)
Logs the given
throwable at Logger.LogLevel.DEBUG level. |
void |
debug(@NotNull Throwable throwable,
@NotNull String message,
Object... args)
|
static @NotNull Logger |
getLogger(@NotNull Class<?> forClass)
Returns an instance of the logger for the given
class . |
void |
info(@NotNull String message,
Object... args)
Logs the given
message at Logger.LogLevel.INFO level. |
void |
info(@NotNull Throwable throwable)
Logs the given
throwable at Logger.LogLevel.INFO level. |
void |
info(@NotNull Throwable throwable,
@NotNull 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(@NotNull Logger.LogLevel logLevel,
@NotNull String message,
Object... args)
Logs the given
message at logLevel . |
void |
log(@NotNull Logger.LogLevel logLevel,
@NotNull Throwable throwable)
Logs the given
throwable at logLevel level. |
void |
log(@NotNull Logger.LogLevel logLevel,
@NotNull Throwable throwable,
@NotNull String message,
Object... args)
Logs the given
throwable and message at logLevel . |
void |
trace(@NotNull String message,
Object... args)
Logs the given
message at Logger.LogLevel.TRACE level. |
void |
trace(@NotNull Throwable throwable)
Logs the given
throwable at Logger.LogLevel.TRACE level. |
void |
trace(@NotNull Throwable throwable,
@NotNull 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 @NotNull Logger getLogger(@NotNull @NotNull Class<?> forClass)
class
.public void info(@NotNull @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 @NotNull Throwable throwable)
throwable
at Logger.LogLevel.INFO
level.public void info(@NotNull @NotNull Throwable throwable, @NotNull @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 @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 @NotNull Throwable throwable)
throwable
at Logger.LogLevel.DEBUG
level.public void debug(@NotNull @NotNull Throwable throwable, @NotNull @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 @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 @NotNull Throwable throwable)
throwable
at Logger.LogLevel.TRACE
level.public void trace(@NotNull @NotNull Throwable throwable, @NotNull @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 @NotNull Logger.LogLevel logLevel, @NotNull @NotNull String message, @NotNull Object... args)
message
at logLevel
. The message is formatted using
String.format(String, Object...)
.public void log(@NotNull @NotNull Logger.LogLevel logLevel, @NotNull @NotNull Throwable throwable)
throwable
at logLevel
level.public void log(@NotNull @NotNull Logger.LogLevel logLevel, @NotNull @NotNull Throwable throwable, @NotNull @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 © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.