add a lot of kdocs

This commit is contained in:
2023-11-18 17:15:23 +06:00
parent 7a8bd035f5
commit 81b32b0119
11 changed files with 106 additions and 3 deletions

View File

@@ -1,8 +1,20 @@
package dev.inmo.kslog.common
/**
* Creating base tag using class simple name of receiver
*
* @throws IllegalStateException If there is no opportunity to take simple name of receiver class
*/
val Any.logTag
get() = this::class.simpleName ?: error("Unable to retrieve log tag")
/**
* Creating [TagLogger] with [logTag] as base tag
*/
val Any.logger: KSLog
get() = TagLogger(logTag)
/**
* Creating [TagLogger] using [logger] extension property with [tagBase] as `this`
*/
fun taggedLogger(tagBase: Any): KSLog = tagBase.logger