Hi, all,
I’m finishing up an add-on and would like to have debug-only print statements for debugging. So like if I have debugging=true, it’ll only print the debug statements. However, I’m having trouble figuring out how to do this. I did a search and tried some experiments and nothing really helped. I tried this:
function debugprint(...)
if debugging == true then
local arg1 = ...;
print(arg1)
end
end
Which works great if I call debugprint(“hello”), but if I want to do something like debugprint("The thing is: ", x), then all I get from debugprint is "The thing is: " and the value of x is lost.
If I add an arg2 to debugprint, it winds up being nil, so what exactly am I missing here?