Impl base schedule navigation; add internal logger
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package ru.fincode.tsudesk.core.common.log
|
||||
|
||||
object Constants {
|
||||
const val LOG_DEBUG_TAG = "LOG_DEBUG_TAG"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package ru.fincode.tsudesk.core.common.log
|
||||
|
||||
import android.util.Log
|
||||
|
||||
private fun Any.moduleTag(): String {
|
||||
val module = this::class.java.`package`?.name?.substringAfterLast(".")?.uppercase() ?: "UNKNOWN"
|
||||
|
||||
return "${Constants.LOG_DEBUG_TAG}:$module"
|
||||
}
|
||||
|
||||
fun Any.logD(message: String) {
|
||||
Log.d(moduleTag(), message)
|
||||
}
|
||||
|
||||
fun Any.logD(message: String, throwable: Throwable) {
|
||||
Log.d(moduleTag(), message, throwable)
|
||||
}
|
||||
|
||||
fun Any.logE(message: String) {
|
||||
Log.e(moduleTag(), message)
|
||||
}
|
||||
|
||||
fun Any.logE(message: String, throwable: Throwable) {
|
||||
Log.e(moduleTag(), message, throwable)
|
||||
}
|
||||
Reference in New Issue
Block a user