aboutsummaryrefslogtreecommitdiffstats
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
commit6537bcfb9aeff46801c2e60ec691ac6e11b4e9b5 (patch)
tree6915ffbfa183172a10820f48771820ae2acee5ba
parent68e02ef7ba78a64216670f1e37a947f12d807a10 (diff)
downloadprosody-6537bcfb9aeff46801c2e60ec691ac6e11b4e9b5.tar.gz
prosody-6537bcfb9aeff46801c2e60ec691ac6e11b4e9b5.zip
util.debug: Move boundary markers to top of relevant sections of the stack trace (easier to follow)
-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