package com.nothing.camera2magic.utils
import android.util.Log
import android.view.Surface

val Surface?.shortId : String
    get() = if (this == null) "null" else "@0x${Integer.toHexString(System.identityHashCode(this))}"

object Dog {
    private const val PREFIX = "[VCX]"

    fun i(tag: String? = null, message: String, enabled: Boolean = true) {
        Log.i("$PREFIX$tag", message)
    }

    fun w(tag: String? = null, message: String, enabled: Boolean = true) {
        Log.w("$PREFIX$tag", message)
    }

    fun e(tag: String? = null, message: String, throwable: Throwable? = null, enabled: Boolean = true) {
        if (throwable != null) Log.e("$PREFIX$tag", message, throwable)
        else Log.e("$PREFIX$tag", message)
    }
}