Object Logger
-
- All Implemented Interfaces:
public class Logger
Static logger for issuing log entries.
-
-
Method Summary
Modifier and Type Method Description final TaggedLogger
tag(String tag)
Gets a tagged logger instance. final TaggedLogger
tags(String tags)
Gets a tagged logger instance that logs to multiple tags. final Boolean
isTraceEnabled()
Checks whether log entries at TRACE level will be output. final Unit
trace(Object message)
Logs a message at TRACE level. final Unit
trace(String message)
Logs a message at TRACE level. final Unit
trace(Function0<String> message)
Logs a lazy message at TRACE level. final Unit
trace(String message, Object arguments)
Logs a formatted message at TRACE level. final Unit
trace(String message, Function0<Object> arguments)
Logs a formatted message at TRACE level. final Unit
trace(Throwable exception)
Logs an exception at TRACE level. final Unit
trace(Throwable exception, String message)
Logs an exception with a custom message at TRACE level. final Unit
trace(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at TRACE level. final Unit
trace(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at TRACE level. final Unit
trace(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at TRACE level. final Boolean
isDebugEnabled()
Checks whether log entries at DEBUG level will be output. final Unit
debug(Object message)
Logs a message at DEBUG level. final Unit
debug(String message)
Logs a message at DEBUG level. final Unit
debug(Function0<String> message)
Logs a lazy message at DEBUG level. final Unit
debug(String message, Object arguments)
Logs a formatted message at DEBUG level. final Unit
debug(String message, Function0<Object> arguments)
Logs a formatted message at DEBUG level. final Unit
debug(Throwable exception)
Logs an exception at DEBUG level. final Unit
debug(Throwable exception, String message)
Logs an exception with a custom message at DEBUG level. final Unit
debug(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at DEBUG level. final Unit
debug(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at DEBUG level. final Unit
debug(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at DEBUG level. final Boolean
isInfoEnabled()
Checks whether log entries at INFO level will be output. final Unit
info(Object message)
Logs a message at INFO level. final Unit
info(String message)
Logs a message at INFO level. final Unit
info(Function0<String> message)
Logs a lazy message at INFO level. final Unit
info(String message, Object arguments)
Logs a formatted message at INFO level. final Unit
info(String message, Function0<Object> arguments)
Logs a formatted message at INFO level. final Unit
info(Throwable exception)
Logs an exception at INFO level. final Unit
info(Throwable exception, String message)
Logs an exception with a custom message at INFO level. final Unit
info(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at INFO level. final Unit
info(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at INFO level. final Unit
info(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at INFO level. final Boolean
isWarnEnabled()
Checks whether log entries at WARN level will be output. final Unit
warn(Object message)
Logs a message at WARN level. final Unit
warn(String message)
Logs a message at WARN level. final Unit
warn(Function0<String> message)
Logs a lazy message at WARN level. final Unit
warn(String message, Object arguments)
Logs a formatted message at WARN level. final Unit
warn(String message, Function0<Object> arguments)
Logs a formatted message at WARN level. final Unit
warn(Throwable exception)
Logs an exception at WARN level. final Unit
warn(Throwable exception, String message)
Logs an exception with a custom message at WARN level. final Unit
warn(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at WARN level. final Unit
warn(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at WARN level. final Unit
warn(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at WARN level. final Boolean
isErrorEnabled()
Checks whether log entries at ERROR level will be output. final Unit
error(Object message)
Logs a message at ERROR level. final Unit
error(String message)
Logs a message at ERROR level. final Unit
error(Function0<String> message)
Logs a lazy message at ERROR level. final Unit
error(String message, Object arguments)
Logs a formatted message at ERROR level. final Unit
error(String message, Function0<Object> arguments)
Logs a formatted message at ERROR level. final Unit
error(Throwable exception)
Logs an exception at ERROR level. final Unit
error(Throwable exception, String message)
Logs an exception with a custom message at ERROR level. final Unit
error(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at ERROR level. final Unit
error(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at ERROR level. final Unit
error(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at ERROR level. -
-
Method Detail
-
tag
final TaggedLogger tag(String tag)
Gets a tagged logger instance. Tags are case-sensitive.
- Parameters:
tag
- Tag for logger ornull
for receiving an untagged logger- Returns:
Logger instance
-
tags
final TaggedLogger tags(String tags)
Gets a tagged logger instance that logs to multiple tags. Tags are case-sensitive.
- Parameters:
tags
- Tags for the logger or nothing for an untagged logger.- Returns:
Logger instance
-
isTraceEnabled
final Boolean isTraceEnabled()
Checks whether log entries at TRACE level will be output.
- Returns:
true
if TRACE level is enabled,false
if disabled
-
trace
final Unit trace(Object message)
Logs a message at TRACE level.
- Parameters:
message
- Any object with a meaningful Any.toString method
-
trace
final Unit trace(String message)
Logs a message at TRACE level.
- Parameters:
message
- Text message to log
-
trace
final Unit trace(Function0<String> message)
Logs a lazy message at TRACE level. The message will be only evaluated if the log entry is really output.
- Parameters:
message
- Function that produces the message
-
trace
final Unit trace(String message, Object arguments)
Logs a formatted message at TRACE level. "{}" placeholders will be replaced by given arguments.
- Parameters:
message
- Formatted text message to logarguments
- Arguments for formatted text message
-
trace
final Unit trace(String message, Function0<Object> arguments)
Logs a formatted message at TRACE level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
trace
final Unit trace(Throwable exception)
Logs an exception at TRACE level.
- Parameters:
exception
- Caught exception or any other throwable to log
-
trace
final Unit trace(Throwable exception, String message)
Logs an exception with a custom message at TRACE level.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Text message to log
-
trace
final Unit trace(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at TRACE level. The message will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Function that produces the message
-
trace
final Unit trace(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at TRACE level. "{}" placeholders will be replaced by given arguments.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text message
-
trace
final Unit trace(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at TRACE level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
isDebugEnabled
final Boolean isDebugEnabled()
Checks whether log entries at DEBUG level will be output.
- Returns:
true
if DEBUG level is enabled,false
if disabled
-
debug
final Unit debug(Object message)
Logs a message at DEBUG level.
- Parameters:
message
- Any object with a meaningful Any.toString method
-
debug
final Unit debug(String message)
Logs a message at DEBUG level.
- Parameters:
message
- Text message to log
-
debug
final Unit debug(Function0<String> message)
Logs a lazy message at DEBUG level. The message will be only evaluated if the log entry is really output.
- Parameters:
message
- Function that produces the message
-
debug
final Unit debug(String message, Object arguments)
Logs a formatted message at DEBUG level. "{}" placeholders will be replaced by given arguments.
- Parameters:
message
- Formatted text message to logarguments
- Arguments for formatted text message
-
debug
final Unit debug(String message, Function0<Object> arguments)
Logs a formatted message at DEBUG level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
debug
final Unit debug(Throwable exception)
Logs an exception at DEBUG level.
- Parameters:
exception
- Caught exception or any other throwable to log
-
debug
final Unit debug(Throwable exception, String message)
Logs an exception with a custom message at DEBUG level.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Text message to log
-
debug
final Unit debug(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at DEBUG level. The message will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Function that produces the message
-
debug
final Unit debug(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at DEBUG level. "{}" placeholders will be replaced by given arguments.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text message
-
debug
final Unit debug(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at DEBUG level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
isInfoEnabled
final Boolean isInfoEnabled()
Checks whether log entries at INFO level will be output.
- Returns:
true
if INFO level is enabled,false
if disabled
-
info
final Unit info(Object message)
Logs a message at INFO level.
- Parameters:
message
- Any object with a meaningful Any.toString method
-
info
final Unit info(String message)
Logs a message at INFO level.
- Parameters:
message
- Text message to log
-
info
final Unit info(Function0<String> message)
Logs a lazy message at INFO level. The message will be only evaluated if the log entry is really output.
- Parameters:
message
- Function that produces the message
-
info
final Unit info(String message, Object arguments)
Logs a formatted message at INFO level. "{}" placeholders will be replaced by given arguments.
- Parameters:
message
- Formatted text message to logarguments
- Arguments for formatted text message
-
info
final Unit info(String message, Function0<Object> arguments)
Logs a formatted message at INFO level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
info
final Unit info(Throwable exception)
Logs an exception at INFO level.
- Parameters:
exception
- Caught exception or any other throwable to log
-
info
final Unit info(Throwable exception, String message)
Logs an exception with a custom message at INFO level.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Text message to log
-
info
final Unit info(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at INFO level. The message will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Function that produces the message
-
info
final Unit info(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at INFO level. "{}" placeholders will be replaced by given arguments.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text message
-
info
final Unit info(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at INFO level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
isWarnEnabled
final Boolean isWarnEnabled()
Checks whether log entries at WARN level will be output.
- Returns:
true
if WARN level is enabled,false
if disabled
-
warn
final Unit warn(Object message)
Logs a message at WARN level.
- Parameters:
message
- Any object with a meaningful Any.toString method
-
warn
final Unit warn(String message)
Logs a message at WARN level.
- Parameters:
message
- Text message to log
-
warn
final Unit warn(Function0<String> message)
Logs a lazy message at WARN level. The message will be only evaluated if the log entry is really output.
- Parameters:
message
- Function that produces the message
-
warn
final Unit warn(String message, Object arguments)
Logs a formatted message at WARN level. "{}" placeholders will be replaced by given arguments.
- Parameters:
message
- Formatted text message to logarguments
- Arguments for formatted text message
-
warn
final Unit warn(String message, Function0<Object> arguments)
Logs a formatted message at WARN level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
warn
final Unit warn(Throwable exception)
Logs an exception at WARN level.
- Parameters:
exception
- Caught exception or any other throwable to log
-
warn
final Unit warn(Throwable exception, String message)
Logs an exception with a custom message at WARN level.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Text message to log
-
warn
final Unit warn(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at WARN level. The message will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Function that produces the message
-
warn
final Unit warn(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at WARN level. "{}" placeholders will be replaced by given arguments.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text message
-
warn
final Unit warn(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at WARN level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
isErrorEnabled
final Boolean isErrorEnabled()
Checks whether log entries at ERROR level will be output.
- Returns:
true
if ERROR level is enabled,false
if disabled
-
error
final Unit error(Object message)
Logs a message at ERROR level.
- Parameters:
message
- Any object with a meaningful Any.toString method
-
error
final Unit error(String message)
Logs a message at ERROR level.
- Parameters:
message
- Text message to log
-
error
final Unit error(Function0<String> message)
Logs a lazy message at ERROR level. The message will be only evaluated if the log entry is really output.
- Parameters:
message
- Function that produces the message
-
error
final Unit error(String message, Object arguments)
Logs a formatted message at ERROR level. "{}" placeholders will be replaced by given arguments.
- Parameters:
message
- Formatted text message to logarguments
- Arguments for formatted text message
-
error
final Unit error(String message, Function0<Object> arguments)
Logs a formatted message at ERROR level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
message
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
error
final Unit error(Throwable exception)
Logs an exception at ERROR level.
- Parameters:
exception
- Caught exception or any other throwable to log
-
error
final Unit error(Throwable exception, String message)
Logs an exception with a custom message at ERROR level.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Text message to log
-
error
final Unit error(Throwable exception, Function0<String> message)
Logs an exception with a custom lazy message at ERROR level. The message will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Function that produces the message
-
error
final Unit error(Throwable exception, String message, Object arguments)
Logs an exception with a formatted custom message at ERROR level. "{}" placeholders will be replaced by given arguments.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Arguments for formatted text message
-
error
final Unit error(Throwable exception, String message, Function0<Object> arguments)
Logs an exception with a formatted message at ERROR level. "{}" placeholders will be replaced by given lazy arguments. The arguments will be only evaluated if the log entry is really output.
- Parameters:
exception
- Caught exception or any other throwable to logmessage
- Formatted text message to logarguments
- Functions that produce the arguments for formatted text message
-
-
-
-