mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 22:10:06 +00:00
add Util.LogDebug
This commit is contained in:
1 file changed
+10
@@ -830,6 +830,16 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, TLuaStateI
|
|||||||
MPTable.set_function("Set", &LuaAPI::MP::Set);
|
MPTable.set_function("Set", &LuaAPI::MP::Set);
|
||||||
|
|
||||||
auto UtilTable = StateView.create_named_table("Util");
|
auto UtilTable = StateView.create_named_table("Util");
|
||||||
|
UtilTable.set_function("LogDebug", [this](sol::variadic_args args) {
|
||||||
|
std::string ToPrint = "";
|
||||||
|
for (const auto& arg : args) {
|
||||||
|
ToPrint += LuaAPI::LuaToString(static_cast<const sol::object>(arg));
|
||||||
|
ToPrint += "\t";
|
||||||
|
}
|
||||||
|
if (Application::Settings.DebugModeEnabled) {
|
||||||
|
beammp_lua_log("DEBUG", mStateId, ToPrint);
|
||||||
|
}
|
||||||
|
});
|
||||||
UtilTable.set_function("LogInfo", [this](sol::variadic_args args) {
|
UtilTable.set_function("LogInfo", [this](sol::variadic_args args) {
|
||||||
std::string ToPrint = "";
|
std::string ToPrint = "";
|
||||||
for (const auto& arg : args) {
|
for (const auto& arg : args) {
|
||||||
|
|||||||
Reference in new issue
Block a user