-
public final class LoggerExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> LoggercreateLogger(T $self, Level minLogLevel, LogContext logContext)Create a logger with an optional minLogLevel and logContext using the fully-qualified name of the actual class (i.e. final static <T extends Any> LoggercreateChildLogger(T $self, Logger parentLogger, Map<String, String> childContext)Create a child logger from parentLogger with any optional childContext using the fully-qualified name of the actual class (i.e. final static <T extends Any> Class<?>getClassForLogging(Class<T> javaClass)Given a Class, get the proper class to be used for the name of a logger by stripping any companion object class identifier, if present. final static Unitcinfo(Logger $self, Function0<String> msg)Note that, although the logger now supports taking a message supplier argument, these methods are still more efficient as they're inline (and therefore don't require constructing a lambda object) final static Unitcdebug(Logger $self, Function0<String> msg)final static Unitcwarn(Logger $self, Function0<String> msg)final static Unitcerror(Logger $self, Function0<String> msg)-
-
Method Detail
-
createLogger
final static <T extends Any> Logger createLogger(T $self, Level minLogLevel, LogContext logContext)
Create a logger with an optional minLogLevel and logContext using the fully-qualified name of the actual class (i.e. the instance's class, not the class that happens to be calling this method).
-
createChildLogger
final static <T extends Any> Logger createChildLogger(T $self, Logger parentLogger, Map<String, String> childContext)
Create a child logger from parentLogger with any optional childContext using the fully-qualified name of the actual class (i.e. the instance's class, not the class that happens to be calling this method).
-
getClassForLogging
final static <T extends Any> Class<?> getClassForLogging(Class<T> javaClass)
Given a Class, get the proper class to be used for the name of a logger by stripping any companion object class identifier, if present.
-
cinfo
final static Unit cinfo(Logger $self, Function0<String> msg)
Note that, although the logger now supports taking a message supplier argument, these methods are still more efficient as they're inline (and therefore don't require constructing a lambda object)
-
-
-
-