Changeset

242:ab4773b0ef5e

verse: Add default log handler for errors
author Matthew Wild <mwild1@gmail.com>
date Sun, 27 Nov 2011 23:00:15 +0000
parents 241:931bf313c691
children 246:6c60d19e2180
files init.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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());