Output
Custom implementations of print
, warn
, error
, and assert
to make formatting error messages easier.
Output.print(
"This script's name is %s and its path is %s", -- String Pattern
{script.Name, script:GetFullName()} -- List or anything that can be represented as a string
)
warn
Output.warn(
"This is a warning without any formatting", -- String Pattern
nil -- Nil in this case due to the pattern not needing any replacements
)
error
Output.error(
"Expected table, instead got %s", -- String Pattern
typeof(x), -- List or anything that can be represented as a string
1 -- Level (defaults to 0 if nil)
)
assert
Output.assert(
typeof(x) == "table", -- Boolean, if true no error will be thrown
"Expected table, instead got %s", -- String Pattern
typeof(x), -- List or anything that can be represented as a string
1 -- Level (defaults to 0 if nil)
)