mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 07:07:32 +08:00
27 lines
714 B
C++
27 lines
714 B
C++
![]() |
#pragma once
|
||
|
|
||
|
namespace lua::log
|
||
|
{
|
||
|
static void info(const std::string& data, sol::this_state state)
|
||
|
{
|
||
|
LOG(INFO) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;
|
||
|
}
|
||
|
|
||
|
static void warning(const std::string& data, sol::this_state state)
|
||
|
{
|
||
|
LOG(WARNING) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;
|
||
|
}
|
||
|
|
||
|
static void debug(const std::string& data, sol::this_state state)
|
||
|
{
|
||
|
LOG(VERBOSE) << sol::state_view(state)["!module_name"].get<std::string>() << ": " << data;
|
||
|
}
|
||
|
|
||
|
static void bind(sol::state& state)
|
||
|
{
|
||
|
auto ns = state["log"].get_or_create<sol::table>();
|
||
|
ns["info"] = info;
|
||
|
ns["warning"] = warning;
|
||
|
ns["debug"] = debug;
|
||
|
}
|
||
|
}
|