package com.placeholder.sherpai2.util

/**
 * Debug feature flags
 *
 * Toggle these to enable/disable diagnostic features
 * Set to false before release builds!
 */
object DebugFlags {

    /**
     * Enable verbose face recognition logging
     *
     * When true:
     * - Logs every face detection
     * - Logs similarity scores
     * - Logs matching decisions
     * - Shows why images are skipped
     *
     * Filter Logcat by: "FaceRecognition"
     */
    const val ENABLE_FACE_RECOGNITION_LOGGING = true  // ← Toggle here

    /**
     * Show confidence scores in UI
     */
    const val SHOW_CONFIDENCE_IN_UI = true  // ← Toggle here

    /**
     * Lower thresholds for better recall (more matches, some false positives)
     */
    const val USE_LIBERAL_THRESHOLDS = true  // ← Toggle here
}

/**
 * Diagnostic logger - only logs when flag is enabled
 */
object DiagnosticLogger {
    private const val TAG = "FaceRecognition"

    fun d(message: String) {
        if (DebugFlags.ENABLE_FACE_RECOGNITION_LOGGING) {
            android.util.Log.d(TAG, message)
        }
    }

    fun i(message: String) {
        if (DebugFlags.ENABLE_FACE_RECOGNITION_LOGGING) {
            android.util.Log.i(TAG, message)
        }
    }

    fun w(message: String) {
        if (DebugFlags.ENABLE_FACE_RECOGNITION_LOGGING) {
            android.util.Log.w(TAG, message)
        }
    }

    fun e(message: String, throwable: Throwable? = null) {
        if (DebugFlags.ENABLE_FACE_RECOGNITION_LOGGING) {
            if (throwable != null) {
                android.util.Log.e(TAG, message, throwable)
            } else {
                android.util.Log.e(TAG, message)
            }
        }
    }
}