mirror of
https://github.com/tursom/TursomServer.git
synced 2025-03-13 11:20:10 +08:00
添加日志工具类
This commit is contained in:
parent
0229dbe0df
commit
87aa8816bd
@ -1,12 +1,13 @@
|
||||
package cn.tursom.log.impl
|
||||
|
||||
import cn.tursom.log.Slf4j
|
||||
import cn.tursom.log.TrySlf4j
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import kotlin.reflect.KClass
|
||||
import kotlin.reflect.jvm.jvmName
|
||||
|
||||
class Slf4jImpl(name: String? = null) : Slf4j {
|
||||
class Slf4jImpl(name: String? = null) : Slf4j, TrySlf4j {
|
||||
constructor(clazz: Class<*>?) : this(clazz?.name)
|
||||
constructor(clazz: KClass<*>?) : this(clazz?.jvmName?.let {
|
||||
if (clazz.isCompanion) it.dropLast(10) else it
|
||||
@ -20,4 +21,7 @@ class Slf4jImpl(name: String? = null) : Slf4j {
|
||||
} else {
|
||||
throw NotImplementedError("")
|
||||
})
|
||||
|
||||
override val logger: Logger get() = log
|
||||
override val sfl4j: Logger get() = log
|
||||
}
|
Loading…
Reference in New Issue
Block a user