From 2bb0618c79e628a18ae862f963c43b207f405f80 Mon Sep 17 00:00:00 2001 From: Don Honerbrink Date: Tue, 17 Nov 2015 22:15:42 +0000 Subject: [PATCH] Created LuaLog implementation --- RetroFE/Source/Lua/LuaLog.cpp | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 RetroFE/Source/Lua/LuaLog.cpp diff --git a/RetroFE/Source/Lua/LuaLog.cpp b/RetroFE/Source/Lua/LuaLog.cpp new file mode 100644 index 0000000..ae6e99d --- /dev/null +++ b/RetroFE/Source/Lua/LuaLog.cpp @@ -0,0 +1,48 @@ +#include "LuaLog.h" +#include "../Utility/Log.h" +#include + +int LuaLog::debug(lua_State *l) +{ + std::string message = luaL_checkstring(l, 1); + + Logger::write(Logger::ZONE_DEBUG, "Script", message) + + return 0; +} + +int LuaLog::info(lua_State *l) +{ + std::string message = luaL_checkstring(l, 1); + + Logger::write(Logger::ZONE_INFO, "Script", message) + + return 0; +} + +int LuaLog::warning(lua_State *l) +{ + std::string message = luaL_checkstring(l, 1); + + Logger::write(Logger::ZONE_WARNING, "Script", message) + + return 0; +} + +int LuaLog::notice(lua_State *l) +{ + std::string message = luaL_checkstring(l, 1); + + Logger::write(Logger::ZONE_NOTICE, "Script", message) + + return 0; +} + +int LuaLog::error(lua_State *l) +{ + std::string message = luaL_checkstring(l, 1); + + Logger::write(Logger::ZONE_ERROR, "Script", message) + + return 0; +} \ No newline at end of file