Package-level declarations

Types

Link copied to clipboard
typealias FixedLogLevel = com.diamondedge.logging.FixedLogLevel

All logging levels are either enabled or disabled.

Link copied to clipboard
typealias KmLog = com.diamondedge.logging.KmLog
Link copied to clipboard
typealias KmLogging = com.diamondedge.logging.KmLogging
Link copied to clipboard
typealias KmModuleLog = com.diamondedge.logging.KmModuleLog

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
typealias Log = com.diamondedge.logging.Log
Link copied to clipboard
typealias Logger = com.diamondedge.logging.Logger
Link copied to clipboard
typealias LogLevel = com.diamondedge.logging.LogLevel

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
typealias LogLevelController = com.diamondedge.logging.LogLevelController
Link copied to clipboard
typealias Platform = com.diamondedge.logging.Platform
Link copied to clipboard
typealias PlatformLogger = com.diamondedge.logging.PlatformLogger
Link copied to clipboard
typealias TagProvider = com.diamondedge.logging.TagProvider
Link copied to clipboard
typealias TimingLog = com.diamondedge.logging.TimingLog

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
typealias VariableLogLevel = com.diamondedge.logging.VariableLogLevel

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

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.