package com.example.godeye.utils

import android.util.Log

object Logger {
    private const val TAG = "GodEye"

    fun d(message: String) {
        Log.d(TAG, "🔍 $message")
        println("🔍 [DEBUG] $message")
    }

    fun i(message: String) {
        Log.i(TAG, "ℹ️ $message")
        println("ℹ️ [INFO] $message")
    }

    fun w(message: String) {
        Log.w(TAG, "⚠️ $message")
        println("⚠️ [WARN] $message")
    }

    fun e(message: String, throwable: Throwable? = null) {
        Log.e(TAG, "❌ $message", throwable)
        println("❌ [ERROR] $message")
        throwable?.printStackTrace()
    }

    // Методы для совместимости с WebRTCManager
    fun debug(tag: String, message: String) {
        Log.d(tag, "🔍 $message")
        println("🔍 [DEBUG] [$tag] $message")
    }

    fun info(tag: String, message: String) {
        Log.i(tag, "ℹ️ $message")
        println("ℹ️ [INFO] [$tag] $message")
    }

    fun error(tag: String, message: String, throwable: Throwable? = null) {
        Log.e(tag, "❌ $message", throwable)
        println("❌ [ERROR] [$tag] $message")
        throwable?.printStackTrace()
    }

    fun step(stepName: String, message: String) {
        Log.d(TAG, "📋 STEP [$stepName]: $message")
        println("📋 STEP [$stepName]: $message")
    }

    fun socket(message: String) {
        Log.d(TAG, "🔌 SOCKET: $message")
        println("🔌 SOCKET: $message")
    }

    fun connection(message: String) {
        Log.d(TAG, "🌐 CONNECTION: $message")
        println("🌐 CONNECTION: $message")
    }

    fun registration(message: String) {
        Log.d(TAG, "📱 REGISTRATION: $message")
        println("📱 REGISTRATION: $message")
    }

    fun camera(message: String) {
        Log.d(TAG, "📷 CAMERA: $message")
        println("📷 CAMERA: $message")
    }

    fun network(message: String) {
        Log.d(TAG, "🌍 NETWORK: $message")
        println("🌍 NETWORK: $message")
    }
}
