proper error logging for _edje_lua_error()

ERR() should not be used there, because _edje_lua_error() is already
an error logging function. Instead we should call eina_log_print()
directly, handling the source of the error.



SVN revision: 46058
This commit is contained in:
Gustavo Sverzut Barbieri 2010-02-10 20:23:27 +00:00
parent 62d9d8bc92
commit 97ebfc5f2b
2 changed files with 8 additions and 3 deletions

View File

@ -141,7 +141,7 @@ struct _Edje_Lua_Edje_Part_Description
};
void
_edje_lua_error(lua_State *L, int err_code)
__edje_lua_error(const char *file, const char *fnc, int line, lua_State *L, int err_code)
{
char *err_type;
@ -163,7 +163,9 @@ _edje_lua_error(lua_State *L, int err_code)
err_type = "unknown";
break;
}
ERR("Lua %s error: %s", err_type, lua_tostring(L, -1));
eina_log_print
(_edje_default_log_dom, EINA_LOG_LEVEL_ERR, file, fnc, line,
"Lua %s error: %s", err_type, lua_tostring(L, -1));
// don't exit. this is BAD. lua script bugs will cause thngs like e to
// exit mysteriously endig your x session. bad!
// exit(-1);

View File

@ -1435,7 +1435,10 @@ void _edje_lua_script_fn_new(Edje *ed);
void _edje_lua_group_fn_new(Edje *ed);
void _edje_lua_init();
void _edje_lua_shutdown();
void _edje_lua_error(lua_State *L, int err_code);
void __edje_lua_error(const char *file, const char *fnc, int line, lua_State *L, int err_code);
#define _edje_lua_error(L, err_code) \
__edje_lua_error(__FILE__, __FUNCTION__, __LINE__, L, err_code)
int _edje_lua_script_only(Edje *ed);
void _edje_lua_script_only_init(Edje *ed);