summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_script_loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/mlua_script_loader.cpp')
-rw-r--r--plugins/MirLua/src/mlua_script_loader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp
index 4ea6c73f80..dc64e2215a 100644
--- a/plugins/MirLua/src/mlua_script_loader.cpp
+++ b/plugins/MirLua/src/mlua_script_loader.cpp
@@ -2,6 +2,7 @@
CLuaScriptLoader::CLuaScriptLoader(lua_State *L) : L(L)
{
+ hLogger = mir_createLog(MODULE, _T("MirLua script loader log"), VARST(_T("%miranda_logpath%\\MirLua.txt")), 0);
}
void CLuaScriptLoader::RegisterScriptsFolder(const char *path)
@@ -18,7 +19,11 @@ void CLuaScriptLoader::RegisterScriptsFolder(const char *path)
void CLuaScriptLoader::LoadScript(const char *path)
{
if (luaL_dofile(L, path))
+ {
+ const char *error = lua_tostring(L, -1);
+ mir_writeLogT(hLogger, _T("%s"), ptrT(mir_utf8decodeT(error)));
printf("%s\n", lua_tostring(L, -1));
+ }
}
void CLuaScriptLoader::LoadScripts(const TCHAR *scriptDir)