Forums » Community Projects

Any way to enable verbose lua debug logs?

Jul 12, 2017 somote link
I'm working on a plugin that is not doing what I want. Lua is not throwing any errors so I am having to debug with nothing to go on. Is there anyway to enable more verbose lua logs so i can debug better?

Thanks in advance.
Jul 12, 2017 draugath link
There isn't anything in the API to produce more verbose error messages for the debugging of a plugin during development besides what you put in it. The DevKit plugin has many tools that are useful for working on plugins, and if you're not already using it, I recommend you check it out.

At present I've forgotten some of the gotchas I've run into over the years that will crash without producing an error. What I usually wind up doing when I have a tricky bug to chase is just placing successive print() calls after every statement or function call that could possibly cause an error, usually with nothing more than a number.

print(1)
print(2)
for i = 1, 10 do
     print(101)
     print(102)
     print(103)
end
print(3)
print(4)

From there I can write more specific debugging messages once I find where it's breaking.