Package 

Class Logger

  • All Implemented Interfaces:

    
    public final class Logger
    
                        

    Logger class with Kotlin improvements like lazy evaluation. It is backed by a logging port.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final String name
    • Constructor Summary

      Constructors 
      Constructor Description
      Logger(KClass<?> type) Logger class with Kotlin improvements like lazy evaluation.
      Logger(String name)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getName()
      final <E extends Throwable> Unit log(LoggingLevel level, E exception, Function1<E, Object> message) Log a message, with associated exception information.
      final Unit log(LoggingLevel level, Function0<Object> message) Log a message.
      final Unit trace(Function0<Object> message) Log a message using TRACE level.
      final Unit debug(Function0<Object> message) Log a message using DEBUG level.
      final Unit info(Function0<Object> message) Log a message using INFO level.
      final Unit warn(Function0<Object> message) Log a message using WARN level.
      final <E extends Throwable> Unit warn(E exception, Function1<E, Object> message) Log a message using WARN level with associated exception information.
      final Unit error(Function0<Object> message) Log a message using ERROR level.
      final <E extends Throwable> Unit error(E exception, Function1<E, Object> message) Log a message using ERROR level with associated exception information.
      final Unit flare(Function0<Object> message) Log a message using TRACE level.
      final Unit time(Long startNanos, Function0<Object> message) Log a message using TRACE level with the logging 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.
      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.
      final Unit setLoggerLevel(LoggingLevel level) Set a logging level for this logger.
      final Boolean isLoggerLevelEnabled(LoggingLevel level) Check if a logging level is enabled for this logger.
      final Boolean isTraceEnabled() Check if the TRACE logging level is enabled for this logger.
      final Boolean isDebugEnabled() Check if the DEBUG logging level is enabled for this logger.
      final Boolean isInfoEnabled() Check if the INFO logging level is enabled for this logger.
      final Boolean isWarnEnabled() Check if the WARN logging level is enabled for this logger.
      final Boolean isErrorEnabled() Check if the ERROR logging level is enabled for this logger.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Logger

        Logger(KClass<?> type)
        Logger class with Kotlin improvements like lazy evaluation.
        Parameters:
        type - Logger type.
      • Logger

        Logger(String name)
        Parameters:
        name - Logger name.
    • Method Detail

      • log

         final <E extends Throwable> Unit log(LoggingLevel level, E exception, Function1<E, Object> message)

        Log a message, with associated exception information.

      • log

         final Unit log(LoggingLevel level, Function0<Object> message)

        Log a message.

      • 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.