Software /
code /
prosody
Changeset
4519:510f4ba7080f
util.debug: Attempt to get debug.traceback() parameter handling correct (again)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 22 Mar 2012 15:07:27 +0000 |
parents | 4518:f2d695d2e31e |
children | 4520:2d85ac26799c |
files | util/debug.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/debug.lua Fri Mar 09 18:46:19 2012 +0000 +++ b/util/debug.lua Thu Mar 22 15:07:27 2012 +0000 @@ -95,7 +95,11 @@ if level and type(message) ~= "string" then return nil, "invalid message"; elseif not level then - level = message or 2; + if type(message) == "number" then + level, message = message, nil; + else + level = 2; + end end message = message and (message.."\n") or "";