-
- All Implemented Interfaces:
public final class LoggerLogger class with Kotlin improvements like lazy evaluation. It is backed by a logging port.
-
-
Method Summary
Modifier and Type Method Description final StringgetName()final Unittrace(Function0<Object> message)Log a message using TRACE level. final Unitdebug(Function0<Object> message)Log a message using DEBUG level. final Unitinfo(Function0<Object> message)Log a message using INFO level. final Unitwarn(Function0<Object> message)Log a message using WARN level. final <E extends Throwable> Unitwarn(E exception, Function1<E, Object> message)Log a message using WARN level with associated exception information. final Uniterror(Function0<Object> message)Log a message using ERROR level. final <E extends Throwable> Uniterror(E exception, Function1<E, Object> message)Log a message using ERROR level with associated exception information. final Unitflare(Function0<Object> message)Log a message using TRACE level. final Unittime(Long startNanos, Function0<Object> message)Log a message using TRACE level with the logging time. final <T extends Any> Ttime(Function0<Object> message, Function0<T> block)Execute a lambda block and log a message using TRACE level with the logging time. final <T extends Any> Ttime(Object message, Function0<T> block)Execute a lambda block and log a message using TRACE level with the logging time. final UnitsetLoggerLevel(LoggingLevel level)Set a logging level for this logger. final BooleanisLoggerLevelEnabled(LoggingLevel level)Check if a logging level is enabled for this logger. final BooleanisTraceEnabled()Check if the TRACE logging level is enabled for this logger. final BooleanisDebugEnabled()Check if the DEBUG logging level is enabled for this logger. final BooleanisInfoEnabled()Check if the INFO logging level is enabled for this logger. final BooleanisWarnEnabled()Check if the WARN logging level is enabled for this logger. final BooleanisErrorEnabled()Check if the ERROR logging level is enabled for this logger. -
-
Method Detail
-
trace
final Unit trace(Function0<Object> message)
Log a message using TRACE level.
- Parameters:
message- The required message to log.
-
debug
final Unit debug(Function0<Object> message)
Log a message using DEBUG level.
- Parameters:
message- The required message to log.
-
info
final Unit info(Function0<Object> message)
Log a message using INFO level.
- Parameters:
message- The required message to log.
-
warn
final Unit warn(Function0<Object> message)
Log a message using WARN level.
- Parameters:
message- The required message to log.
-
warn
final <E extends Throwable> Unit warn(E exception, Function1<E, Object> message)
Log a message using WARN level with associated exception information.
- Parameters:
exception- The exception associated with log message.message- The message to log (optional).
-
error
final Unit error(Function0<Object> message)
Log a message using ERROR level.
- Parameters:
message- The required message to log.
-
error
final <E extends Throwable> Unit error(E exception, Function1<E, Object> message)
Log a message using ERROR level with associated exception information.
- Parameters:
exception- The exception associated with log message.message- The message to log (optional).
-
flare
final Unit flare(Function0<Object> message)
Log a message using TRACE level.
- Parameters:
message- The required message to log.
-
time
final Unit time(Long startNanos, Function0<Object> message)
Log a message using TRACE level with the logging time.
- Parameters:
startNanos- The start logging time in nanoseconds.message- The required message to log.
-
time
final <T extends Any> T time(Function0<Object> message, Function0<T> block)
Execute a lambda block and log a message using TRACE level with the logging time.
- Parameters:
message- The required message to log.block- The lambda block to execute.
-
time
final <T extends Any> T time(Object message, Function0<T> block)
Execute a lambda block and log a message using TRACE level with the logging time.
- Parameters:
message- The required message to log.block- The lambda block to execute.
-
setLoggerLevel
final Unit setLoggerLevel(LoggingLevel level)
Set a logging level for this logger.
- Parameters:
level- One of the logging levels identifiers, e.g.
-
isLoggerLevelEnabled
final Boolean isLoggerLevelEnabled(LoggingLevel level)
Check if a logging level is enabled for this logger.
- Parameters:
level- One of the logging levels identifiers, e.g.
-
isTraceEnabled
final Boolean isTraceEnabled()
Check if the TRACE logging level is enabled for this logger.
-
isDebugEnabled
final Boolean isDebugEnabled()
Check if the DEBUG logging level is enabled for this logger.
-
isInfoEnabled
final Boolean isInfoEnabled()
Check if the INFO logging level is enabled for this logger.
-
isWarnEnabled
final Boolean isWarnEnabled()
Check if the WARN logging level is enabled for this logger.
-
isErrorEnabled
final Boolean isErrorEnabled()
Check if the ERROR logging level is enabled for this logger.
-
-
-
-