Software /
code /
verse
Diff
init.lua @ 242:ab4773b0ef5e
verse: Add default log handler for errors
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 27 Nov 2011 23:00:15 +0000 |
parent | 241:931bf313c691 |
child | 247:7c58c16efa3e |
line wrap: on
line diff
--- a/init.lua Sun Nov 27 22:59:59 2011 +0000 +++ b/init.lua Sun Nov 27 23:00:15 2011 +0000 @@ -55,6 +55,11 @@ end end +function _default_log_handler(name, level, message) + return io.stderr:write(name, "\t", level, "\t", message, "\n"); +end +verse.set_log_handler(_default_log_handler, { "error" }); + local function error_handler(err) verse.log("error", "Error: %s", err); verse.log("error", "Traceback: %s", debug.traceback());