1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

NKAI: visual logger

This commit is contained in:
Andrii Danylchenko
2024-02-03 12:19:48 +02:00
parent a090441672
commit 047e076d05
6 changed files with 167 additions and 0 deletions

View File

@@ -37,6 +37,7 @@
#include "../lib/modding/ModUtility.h"
#include "../lib/CHeroHandler.h"
#include "../lib/VCMIDirs.h"
#include "../lib/logging/VisualLogger.h"
#include "CMT.h"
#ifdef SCRIPTING_ENABLED
@@ -427,6 +428,14 @@ void ClientCommandManager::handleCrashCommand()
//disaster!
}
void ClientCommandManager::handleVsLog(std::istringstream & singleWordBuffer)
{
std::string key;
singleWordBuffer >> key;
logVisual->setKey(key);
}
void ClientCommandManager::printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType)
{
switch(messageType)
@@ -546,6 +555,9 @@ void ClientCommandManager::processCommand(const std::string & message, bool call
else if(commandName == "crash")
handleCrashCommand();
else if(commandName == "vslog")
handleVsLog(singleWordBuffer);
else
{
if (!commandName.empty() && !vstd::iswithin(commandName[0], 0, ' ')) // filter-out debugger/IDE noise