mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2026-11-11 05:43:29 +00:00
add a lot of kdocs
This commit is contained in:
1 parent
7a8bd035f5
commit
81b32b0119
11 files changed
+106
-3
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user