Skip to content

Commit

Permalink
feat(utilities): Automatically cast anything passed to SU.debug to a …
Browse files Browse the repository at this point in the history
…string
  • Loading branch information
alerque committed Feb 8, 2024
1 parent 4293318 commit da80c56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/utilities/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ utilities.debug = function (category, ...)
for i, input in ipairs(inputs) do
if type(input) == "function" then
local status, output = pcall(input)
inputs[i] = status and output or SU.warn(("Output of %s debug function was an error: %s"):format(category, output))
inputs[i] = status and tostring(output) or SU.warn(("Output of %s debug function was an error: %s"):format(category, output))
elseif type(input) ~= "string" then
inputs[i] = tostring(input)
end
end
local message = utilities.concat(inputs, " ")
Expand Down

0 comments on commit da80c56

Please sign in to comment.