view Modules/Debug.lua @ 20:ff9a698caebc

Added options for the crafting threshold and auction threshold. I also fixed the queue to use the item cost to determine if there is enough profit instead of the auction (QA) threshold which already has profit built in.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sun, 04 Jul 2010 09:33:25 -0700
parents 56de19d9bd8d
children 66b7c3f5937e
line wrap: on
line source
local addonName, addonTable = ...; 
local addon = _G[addonName]

local utils = addonTable.utils


function addon:Debug(msg)
	if self.db.profile.messages.debug then
		self:Print(msg)
	end
end

function addon:GetDebug(info)
       return self.db.profile.messages.debug
end

function addon:SetDebug(info, input)
       self.db.profile.messages.debug = input
       local value = "off"
       if input then
               value = "on"
       end
       self:Print("Debugging is now: " .. value)
end

local function DebugEventRegistration()
	addon.OriginalRegisterEvent = addon.RegisterEvent 
	addon.OriginalUnregisterEvent = addon.UnregisterEvent

	function addon:RegisterEvent(event, callback, arg)
	   self:Debug("RegisterEvent " .. event )
	   if arg ~= nil then
	      addon:OriginalRegisterEvent(event, callback, arg)
	   elseif callback ~= nil then
	      addon:OriginalRegisterEvent(event, callback)
	   else
	      addon:OriginalRegisterEvent(event)
	   end
	end

	function addon:UnregisterEvent(event)
		self:Debug("UnregisterEvent " .. event )
		addon:OriginalUnregisterEvent (event)
	end

end





-- DebugEventRegistration()