This commit is contained in:
Quentin
2023-07-02 00:59:02 +02:00
committed by GitHub
parent f96356960a
commit 3bdd0796f4
56 changed files with 2804 additions and 24 deletions

View File

@ -1,17 +1,37 @@
#pragma once
#include "lua/sol.hpp"
namespace lua::log
{
// Lua API: Table
// Name: log
// Table containing functions for printing to console / log file.
// Lua API: Function
// Table: log
// Name: info
// Param: data: string
// Logs an informational message.
static void info(const std::string& data, sol::this_state state)
{
LOG(INFO) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;
}
// Lua API: Function
// Table: log
// Name: warning
// Param: data: string
// Logs a warning message.
static void warning(const std::string& data, sol::this_state state)
{
LOG(WARNING) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;
}
// Lua API: Function
// Table: log
// Name: debug
// Param: data: string
// Logs a debug message.
static void debug(const std::string& data, sol::this_state state)
{
LOG(VERBOSE) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;