Package com.hexagonkt.core.logging
Class Logger
-
- All Implemented Interfaces:
public final class LoggerLogger class with Kotlin usability improvements. It is backed by a System.Logger instance.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringname
-
Method Summary
Modifier and Type Method Description final StringgetName()final BooleanisLoggable(System.Logger.Level level)Check if this logger is enabled for a given log level. final <E extends Throwable> Unitlog(System.Logger.Level level, E exception, Function1<E, Object> message)Log a message, with associated exception information. final Unitlog(System.Logger.Level level, Function0<Object> message)Log a message. 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 WARNING level. final <E extends Throwable> Unitwarn(E exception, Function1<E, Object> message)Log a message using WARNING 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. -
-
Method Detail
-
getName
final String getName()
-
isLoggable
final Boolean isLoggable(System.Logger.Level level)
Check if this logger is enabled for a given log level.
- Parameters:
level- Level to check.- Returns:
True if this logger is enabled for the supplied level.
-
log
final <E extends Throwable> Unit log(System.Logger.Level level, E exception, Function1<E, Object> message)
Log a message, with associated exception information.
- Parameters:
level- Level used in the log statement.exception- The exception associated with log message.message- The message supplier to use in the log statement.
-
log
final Unit log(System.Logger.Level level, Function0<Object> message)
Log a message.
- Parameters:
level- Level used in the log statement.message- The message supplier to use in the log statement.
-
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 WARNING 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 WARNING 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.
-
-
-
-