Package-level declarations

Types

Link copied to clipboard

All logging levels are either enabled or disabled.

Link copied to clipboard
open class KmLog(tag: String)
Link copied to clipboard
object KmLogging
Link copied to clipboard
class KmModuleLog(val log: KmLog, val isModuleLogging: () -> Boolean)

Wrapper for KmLog that allows library modules to also use KmLogging and be able to enable or disable its logging independently of the application that is also using KmLogging.

Link copied to clipboard
class Log
Link copied to clipboard
interface LogFactory
Link copied to clipboard
Link copied to clipboard
interface LoggerApi
Link copied to clipboard

Enum representing a log level where that level and all succeeding less granular levels are enabled. Verbose is the lowest level means all levels are enabled and Error means only Error

Link copied to clipboard
Link copied to clipboard
object Platform
Link copied to clipboard
Link copied to clipboard
class Slf4jLog(tag: String, className: String) : KmLog
Link copied to clipboard
Link copied to clipboard
interface TagProvider
Link copied to clipboard
class TimingLog(label: String, tag: String? = null)

Add logs containing how long it took to do each section. The logs will be added at the debug log level so the debug log level must be enabled. Verbose level logging creates a new section which is also totaled by the next debug level logs. If only logging debug level then the verbose level logs are not sent to the logs. Usage: val log = TimingLog("work") ... do work A (taking 5 ms) log.debug { "A" } ... do work B 1 (taking 1 ms) log.verbose { "B 1" } ... do work B 2 (taking 3 ms) log.verbose { "B 2" } log.debug { "B" } log.finish()

Link copied to clipboard

Each logging level is controlled by the bit mask of the given log level.

Properties

Link copied to clipboard
const val DEBUG_MASK: Int = 8
Link copied to clipboard
const val ERROR_MASK: Int = 1
Link copied to clipboard
const val INFO_MASK: Int = 4
Link copied to clipboard
const val VERBOSE_MASK: Int = 16
Link copied to clipboard
const val WARN_MASK: Int = 2

Functions

Link copied to clipboard
fun logging(tag: String? = null): KmLog

Create a logging object. This is the primary entry point for logging and should be called once for each file, class or object. For classes a val can be created either as a private member of the class or as a member of the companion object.