-- This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
-- To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
-- or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

local MereHealingFrames, privateVars = ...

MereHealingFrames.DebugLevel = 0

local function Debug(level, text, ...)
  if (level <= MereHealingFrames.DebugLevel) then
    return print(string.format(text or 'nil', ...))
  end
end

local function DebugDump(level, ...)
  if (level <= MereHealingFrames.DebugLevel) then
    return dump(...)
  end
end

local function doNothing (...)
end

MereHealingFrames.DebugDump = doNothing
MereHealingFrames.Debug = doNothing

function MereHealingFrames.ChangeDebugLevel(newLevel)
    MereHealingFrames.DebugLevel = newLevel
    if (newLevel == 0) then
        MereHealingFrames.DebugDump = doNothing
        MereHealingFrames.Debug = doNothing
    else
        MereHealingFrames.DebugDump = DebugDump
        MereHealingFrames.Debug = Debug
    end

end