-- ============================================================================
-- Logging Service
-- ============================================================================
AIOS_CopyBox_Logger = {
    prefix = "|cff66ccffAIOS CopyBox|r",
    debugMode = false
}

function AIOS_CopyBox_Logger:Initialize()
    -- Initialization if needed
end

function AIOS_CopyBox_Logger:Info(message, module)
    local formatted = string.format("%s |cffffffff[INFO]|r %s: %s", self.prefix, module or "Main", tostring(message))
    DEFAULT_CHAT_FRAME:AddMessage(formatted)
end

function AIOS_CopyBox_Logger:Warn(message, module)
    local formatted = string.format("%s |cffffff00[WARN]|r %s: %s", self.prefix, module or "Main", tostring(message))
    DEFAULT_CHAT_FRAME:AddMessage(formatted)
end

function AIOS_CopyBox_Logger:Error(message, module)
    local formatted = string.format("%s |cffff0000[ERROR]|r %s: %s", self.prefix, module or "Main", tostring(message))
    DEFAULT_CHAT_FRAME:AddMessage(formatted)
end

function AIOS_CopyBox_Logger:Debug(message, module)
    if self.debugMode then
        local formatted = string.format("%s |cff00ff00[DEBUG]|r %s: %s", self.prefix, module or "Main", tostring(message))
        DEFAULT_CHAT_FRAME:AddMessage(formatted)
    end
end

function AIOS_CopyBox_Logger:SetDebugMode(enabled)
    self.debugMode = enabled
    self:Info(string.format("Debug mode %s", enabled and "enabled" or "disabled"))
end