feat: add some info and app logging messages

This commit is contained in:
k0t9i
2023-10-17 23:08:41 +04:00
parent ab85800275
commit a2428bb0d1
12 changed files with 63 additions and 16 deletions

View File

@@ -3,6 +3,7 @@
#include <Windows.h>
#include "NamedPipe.h"
#include "../Common/Common.h"
#include "Domain/Services/ServiceLocator.h"
using namespace L2Bot::Domain;
@@ -11,26 +12,24 @@ class NamedPipeTransport : public Transports::TransportInterface
public:
const bool Connect() override
{
OutputDebugStringW(m_PipeName.c_str());
if (!m_ConnectionPipe.Connect(m_PipeName))
{
return false;
}
OutputDebugStringA("Client connected to connection pipe");
Services::ServiceLocator::GetInstance().GetLogger()->Info(L"client connected to the connection pipe ""{}""", m_PipeName);
const auto mainPipeName = GenerateUUID();
m_ConnectionPipe.Send(mainPipeName);
OutputDebugStringA("Name of main pipe sended");
Services::ServiceLocator::GetInstance().GetLogger()->Info(L"name ""{}"" of the main pipe sended", mainPipeName);
if (!m_Pipe.Connect(mainPipeName))
{
OutputDebugStringA(std::to_string(GetLastError()).c_str());
return false;
}
OutputDebugStringA("Client connected to main pipe");
Services::ServiceLocator::GetInstance().GetLogger()->Info(L"client connected to the main pipe ""{}""", mainPipeName);
m_Pipe.Send(L"Hello!");