logging.Logging.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hexagon_core Show documentation
Show all versions of hexagon_core Show documentation
Hexagon core utilities. Includes serialization and logging helpers.
The newest version!
package com.hexagonkt.logging
/** Default logger for when you feel too lazy to declare one. */
val logger: Logger by lazy { Logger(Logger::class) }
/**
* Uses this [T] to log a message with a prefix using [TRACE][LoggingLevel.TRACE] level.
*
* com.hexagonkt.logging.Logger must have TRACE level
*
* TODO Add use case and example in documentation.
*
* @receiver .
* @param prefix .
* @return .
*/
fun T.trace(prefix: String = ""): T =
apply { logger.trace { "$prefix$this" } }
/**
* Uses this [T] to log a message with a prefix using [DEBUG][LoggingLevel.DEBUG] level.
*
* com.hexagonkt.logging.Logger must have DEBUG level
*
* TODO Add use case and example in documentation.
*
* @receiver .
* @param prefix .
* @return .
*/
fun T.debug(prefix: String = ""): T =
apply { logger.debug { "$prefix$this" } }
/**
* Uses this [T] to log a message with a prefix using [INFO][LoggingLevel.INFO] level.
*
* com.hexagonkt.logging.Logger must have INFO level
*
* TODO Add use case and example in documentation.
*
* @receiver .
* @param prefix .
* @return .
*/
fun T.info(prefix: String = ""): T =
apply { logger.info { "$prefix$this" } }
© 2015 - 2024 Weber Informatics LLC | Privacy Policy