debug: Log package name

This commit is contained in:
Danny Lin 2022-12-21 01:30:03 -08:00
parent 056aed6e46
commit cae30da9ec

View File

@ -1,5 +1,6 @@
package dev.kdrag0n.safetynetfix
import android.app.Application
import android.util.Log
private const val DEBUG = true
@ -13,12 +14,12 @@ internal fun <T> Any.get(name: String) = this::class.java.getDeclaredField(name)
internal fun logDebug(msg: String) {
if (DEBUG) {
Log.d(TAG, msg)
Log.d(TAG, "[${Application.getProcessName()}] $msg")
}
}
internal fun logDebug(msg: String, e: Throwable) {
if (DEBUG) {
Log.d(TAG, msg, e)
Log.d(TAG, "[${Application.getProcessName()}] $msg", e)
}
}