View Single Post
04/26/14, 11:28 AM   #7
LilBudyWizer
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
It can be useful, but mostly as a debugging aid. Rather than an option the user can turn on and off you might consider just making it a debug option. I use:

Lua Code:
  1. addon =
  2. {
  3.     ...
  4.     debug =
  5.     {
  6.     }
  7.     ...
  8. }

The debug variable acts as a switch for general debugging. Specific parts of debugging, like logging events and such, are controlled with variables within that table. I then just change it to nodebug when I want to turn it off for release. I can always turn it back on at the command line with addon.debug = addon.nodebug. The actual check in the code for suboptions is:

Lua Code:
  1. if (addon.debug and addon.debug.option) then
  2. end

where addon is the global for the addon, i.e. the addon name.
  Reply With Quote