aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-03-22 16:51:39 +0000
committerMatthew Wild <mwild1@gmail.com>2012-03-22 16:51:39 +0000
commita1b3f76c8c2d381950fc51b1ee89dd059898766f (patch)
tree6915ffbfa183172a10820f48771820ae2acee5ba /util
parent9794c49ceae42113b1b80e53b57745c19ffc66bf (diff)
downloadprosody-a1b3f76c8c2d381950fc51b1ee89dd059898766f.tar.gz
prosody-a1b3f76c8c2d381950fc51b1ee89dd059898766f.zip
util.debug: Move boundary markers to top of relevant sections of the stack trace (easier to follow)
Diffstat (limited to 'util')
-rw-r--r--util/debug.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/util/debug.lua b/util/debug.lua
index d63dce1b..3736dd34 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -113,7 +113,7 @@ end
local function build_source_boundary_marker(last_source_desc)
local padding = string.rep("-", math.floor(((optimal_line_length - 6) - #last_source_desc)/2));
- return getstring(styles.boundary_padding, "^"..padding).." "..getstring(styles.filename, last_source_desc).." "..getstring(styles.boundary_padding, padding..(#last_source_desc%2==0 and "-^" or "^ "));
+ return getstring(styles.boundary_padding, "v"..padding).." "..getstring(styles.filename, last_source_desc).." "..getstring(styles.boundary_padding, padding..(#last_source_desc%2==0 and "-v" or "v "));
end
function debug._traceback(thread, message, level)
@@ -158,10 +158,8 @@ function debug._traceback(thread, message, level)
line = "[Lua] "..getstring(styles.location, info.short_src.." line "..info.currentline).." in "..func_type..getstring(styles.funcname, name).." (defined on line "..info.linedefined..")";
end
if source_desc ~= last_source_desc then -- Venturing into a new source, add marker for previous
- if last_source_desc then
- table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc));
- end
last_source_desc = source_desc;
+ table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc));
end
nlevel = nlevel-1;
table.insert(lines, "\t"..(nlevel==0 and ">" or " ")..getstring(styles.level_num, "("..nlevel..") ")..line);
@@ -176,7 +174,7 @@ function debug._traceback(thread, message, level)
end
end
- table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc));
+-- table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc));
return message.."stack traceback:\n"..table.concat(lines, "\n");
end