Asa@63: local ItemAuditor = select(2, ...) Asa@63: local Debug = ItemAuditor:NewModule("Debug") Asa@63: local ItemAuditor = ItemAuditor Asa@3: Asa@63: function ItemAuditor:Debug(msg, ...) Asa@24: msg = format(msg, ...) Asa@22: self:Log(msg, " |cffffff00DEBUG") Asa@22: end Asa@22: Asa@63: function ItemAuditor:Log(message, prefix) Asa@22: prefix = prefix or "" Asa@22: ItemAuditor_DebugFrameTxt:AddMessage(format("%d%s|r: %s", time(), prefix, tostring(message))) Asa@3: end Asa@3: Asa@63: function ItemAuditor:GetDebug(info) Asa@16: return self.db.profile.messages.debug Asa@16: end Asa@16: Asa@63: function ItemAuditor:SetDebug(info, input) Asa@16: self.db.profile.messages.debug = input Asa@16: local value = "off" Asa@16: if input then Asa@16: value = "on" Asa@16: end Asa@16: self:Print("Debugging is now: " .. value) Asa@16: end Asa@16: Asa@3: local function DebugEventRegistration() Asa@63: ItemAuditor.OriginalRegisterEvent = ItemAuditor.RegisterEvent Asa@63: ItemAuditor.OriginalUnregisterEvent = ItemAuditor.UnregisterEvent Asa@3: Asa@63: function ItemAuditor:RegisterEvent(event, callback, arg) Asa@3: self:Debug("RegisterEvent " .. event ) Asa@3: if arg ~= nil then Asa@63: ItemAuditor:OriginalRegisterEvent(event, callback, arg) Asa@3: elseif callback ~= nil then Asa@63: ItemAuditor:OriginalRegisterEvent(event, callback) Asa@3: else Asa@63: ItemAuditor:OriginalRegisterEvent(event) Asa@3: end Asa@3: end Asa@3: Asa@63: function ItemAuditor:UnregisterEvent(event) Asa@3: self:Debug("UnregisterEvent " .. event ) Asa@63: ItemAuditor:OriginalUnregisterEvent (event) Asa@3: end Asa@3: Asa@3: end Asa@3: Asa@3: Asa@3: Asa@3: Asa@3: Asa@7: -- DebugEventRegistration()