Debug LUA script

Hi!

What’s the best way to debug a lua script? I mean of course you cannot stop HAproxy at a given time or a given line I suspect, however, I want to insert some debug messages at any line.

Is this possible? If yes, what’s the best practice and of course where would those debug messages go to see them at runtime?