summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anylike.org>2009-12-25 09:45:25 +0000
committerChristian Pointner <equinox@anylike.org>2009-12-25 09:45:25 +0000
commit64ed9ffac4069e4d3f62ca0e72cb6f50ab7983cc (patch)
tree63f3569a95550236f7401fdce4cd6a334c79f0f4
parentadded lua library for logging (diff)
added lua_error
-rw-r--r--src/l_log.c6
-rw-r--r--src/main_loop.lua3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/l_log.c b/src/l_log.c
index fa587b1..d3319cb 100644
--- a/src/l_log.c
+++ b/src/l_log.c
@@ -66,11 +66,13 @@ static int l_log_print(lua_State *L)
else if(!strncmp("DEBUG", prio_str, 6))
prio = DEBUG;
else {
-// this is an error ...
+ lua_pushstring(L, "invalid log priority");
+ lua_error(L);
}
}
else {
-// thist is an error as well
+ lua_pushstring(L, "invalid log priority");
+ lua_error(L);
}
log_printf(prio, "lua: %s", luaL_checklstring(L, 2, NULL));
diff --git a/src/main_loop.lua b/src/main_loop.lua
index e3dfb71..746570e 100644
--- a/src/main_loop.lua
+++ b/src/main_loop.lua
@@ -27,4 +27,5 @@ log.print("NOTICE", "main_loop started");
log.print("DEBUG", "yet anoter message");
-log.print("ERROR", "this is an error"); \ No newline at end of file
+log.print("ERROR", "this is an error");
+