Provides an API and slash commands for outputting variable information to chat. The information is presented in the following format: index type value name
index - an integer starting with one and incrementing for each new line
type - the return of type(variable), or the return of variable:GetObjectType() if applicable
value - the return of tostring(variable) (functions, tables, threads, and userdata the return is truncated so that "table: 0000B6D0" is instead "B6D0")
name - the global name for the variable if one exists (for functions, tables, threads, and userdata only). If the variable is a table and has a GetName method then the name will be colored yellow if _G[variable:GetName()] == variable or red otherwise
The formatted output is also preceded and trailed by blank lines as needed to help make reading multiple different output calls easier.
API
output(...)
Output variable information as described above.
Arguments:
... - (any) Variables to have their information output.
output.chatFrame = variable
Change which chat frame output is directed to.
Arguments:
variable - (number or nil) The index of the desired chat frame, a value of 0 or nil will use DEFAULT_CHAT_FRAME.
(string) The name of the desired chat frame
(table) The chat frame object to use
output.header(...)
Similar to print(...) but will add a blank line before outputting if needed and will not result in a blank line between it and any
output calls that immediately follow.
Arguments:
... - (any) The information to be output.
output.ipairs(variable)
Output information for the array portion of a table.
Arguments:
variable - (table) Table to have its array contents output.
output.metatable(variable)
Syntactic sugar for output(getmetatable(variable)) or output.pairs(getmetatable(variable)) or output.pairs(getmetatable(variable).__index) as appropriate.
Arguments:
variable - (any) The variable whose metatable information should be output.
output.pairs(variable)
Output information for each key - value pair contained in a table.
Arguments:
variable - (table) Table to have its contents output.
output.parse(variable)
Syntactic sugar for output(SecureCmdOptionParse(variable)).
Arguments:
variable - (string) The parameters to be parsed.
output.print(...)
Similar to print(...) but will output to output.chatFrame instead. This function will not automatically add preceding and trailing blank lines like the other functions do.
Arguments:
... - (any) The information to be output.
Slash Commands
/print ... - Same as /run output.print(...)
/out ... - Same as /run output(...)
/output ... - Same as /run output(...)
/ipairs ... - Same as /run output.ipairs(...)
/pairs ... - Same as /run output.pairs(...)
/parse ... - Same as /run output.parse(...)
/metatable ... - Same as /run outpu*****tatable(...)