Skip to content

Commit

Permalink
feat: log commands output (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-o-b-o-t-o committed Dec 29, 2022
1 parent 4395d9c commit fe9b002
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/LuaEngine/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,12 @@ namespace LuaGlobalFunctions
{
const char* command = Eluna::CHECKVAL<const char*>(L, 1);
#if defined TRINITY || AZEROTHCORE
eWorld->QueueCliCommand(new CliCommandHolder(nullptr, command, nullptr, nullptr));
eWorld->QueueCliCommand(new CliCommandHolder(nullptr, command, [](void* obj, std::string_view view)
{
std::string str = { view.begin(), view.end() };
str.erase(std::find_if(str.rbegin(), str.rend(), [](unsigned char ch) { return !std::isspace(ch); }).base(), str.end()); // Remove trailing spaces and line breaks
ELUNA_LOG_INFO("{}", str);
}, nullptr));
#elif defined MANGOS
eWorld->QueueCliCommand(new CliCommandHolder(0, SEC_CONSOLE, nullptr, command, nullptr, nullptr));
#endif
Expand Down

0 comments on commit fe9b002

Please sign in to comment.