Add missing tags in logs

This commit is contained in:
morg 2025-01-10 08:53:31 +01:00
parent f8e04f5f0f
commit 59e303c882
13 changed files with 78 additions and 78 deletions

View file

@ -49,7 +49,7 @@ NetworkClientInfo::~NetworkClientInfo()
{
if(client_sock != INVALID_SOCKET)
{
LOG_INFO("NetworkServer: Closing server connection: %s", client_ip.c_str());
LOG_INFO("[NetworkServer] Closing server connection: %s", client_ip.c_str());
delete client_listen_thread;
shutdown(client_sock, SD_RECEIVE);
closesocket(client_sock);
@ -269,7 +269,7 @@ void NetworkServer::StartServer()
if(err)
{
LOG_ERROR("NetworkServer: Unable to get address.");
LOG_ERROR("[NetworkServer] Unable to get address.");
WSACleanup();
return;
}
@ -283,7 +283,7 @@ void NetworkServer::StartServer()
if(server_sock[socket_count] == INVALID_SOCKET)
{
LOG_ERROR("NetworkServer: Network socket could not be created.");
LOG_ERROR("[NetworkServer] Network socket could not be created.");
WSACleanup();
return;
}
@ -295,23 +295,23 @@ void NetworkServer::StartServer()
{
if(errno == EADDRINUSE)
{
LOG_ERROR("NetworkServer: Could not bind network socket. Is port %hu already being used?", GetPort());
LOG_ERROR("[NetworkServer] Could not bind network socket. Is port %hu already being used?", GetPort());
}
else if(errno == EACCES)
{
LOG_ERROR("NetworkServer: Could not bind network socket. Access to socket was denied.");
LOG_ERROR("[NetworkServer] Could not bind network socket. Access to socket was denied.");
}
else if(errno == EBADF)
{
LOG_ERROR("NetworkServer: Could not bind network socket. sockfd is not a valid file descriptor.");
LOG_ERROR("[NetworkServer] Could not bind network socket. sockfd is not a valid file descriptor.");
}
else if(errno == EINVAL)
{
LOG_ERROR("NetworkServer: Could not bind network socket. The socket is already bound to an address, or addrlen is wrong, or addr is not a valid address for this socket's domain.");
LOG_ERROR("[NetworkServer] Could not bind network socket. The socket is already bound to an address, or addrlen is wrong, or addr is not a valid address for this socket's domain.");
}
else if(errno == ENOTSOCK)
{
LOG_ERROR("NetworkServer: Could not bind network socket. The file descriptor sockfd does not refer to a socket.");
LOG_ERROR("[NetworkServer] Could not bind network socket. The file descriptor sockfd does not refer to a socket.");
}
else
{
@ -319,7 +319,7 @@ void NetworkServer::StartServer()
| errno could be a Linux specific error, see: |
| https://man7.org/linux/man-pages/man2/bind.2.html |
\*---------------------------------------------------------*/
LOG_ERROR("NetworkManager: Could not bind network socket. Error code: %d.", errno);
LOG_ERROR("[NetworkServer] Could not bind network socket. Error code: %d.", errno);
}
WSACleanup();
@ -391,7 +391,7 @@ void NetworkServer::ConnectionThreadFunction(int socket_idx)
/*---------------------------------------------------------*\
| This thread handles client connections |
\*---------------------------------------------------------*/
LOG_INFO("NetworkServer: Network connection thread started on port %hu", GetPort());
LOG_INFO("[NetworkServer] Network connection thread started on port %hu", GetPort());
while(server_online == true)
{
@ -407,7 +407,7 @@ void NetworkServer::ConnectionThreadFunction(int socket_idx)
\*---------------------------------------------------------*/
if(listen(server_sock[socket_idx], 10) < 0)
{
LOG_INFO("NetworkServer: Connection thread closed");
LOG_INFO("[NetworkServer] Connection thread closed");
server_online = false;
return;
@ -423,7 +423,7 @@ void NetworkServer::ConnectionThreadFunction(int socket_idx)
if(client_info->client_sock < 0)
{
LOG_INFO("NetworkServer: Connection thread closed");
LOG_INFO("[NetworkServer] Connection thread closed");
server_online = false;
server_listening = false;
@ -482,7 +482,7 @@ void NetworkServer::ConnectionThreadFunction(int socket_idx)
ClientInfoChanged();
}
LOG_INFO("NetworkServer: Connection thread closed");
LOG_INFO("[NetworkServer] Connection thread closed");
server_online = false;
server_listening = false;
ServerListeningChanged();
@ -552,7 +552,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
{
SOCKET client_sock = client_info->client_sock;
LOG_INFO("NetworkServer: Network server started");
LOG_INFO("[NetworkServer] Network server started");
/*---------------------------------------------------------*\
| This thread handles messages received from clients |
@ -572,7 +572,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
if(bytes_read <= 0)
{
LOG_ERROR("NetworkServer: recv_select failed receiving magic, closing listener");
LOG_ERROR("[NetworkServer] recv_select failed receiving magic, closing listener");
goto listen_done;
}
@ -581,7 +581,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
\*---------------------------------------------------------*/
if(header.pkt_magic[i] != openrgb_sdk_magic[i])
{
LOG_ERROR("NetworkServer: Invalid magic received");
LOG_ERROR("[NetworkServer] Invalid magic received");
continue;
}
}
@ -601,7 +601,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
if(tmp_bytes_read <= 0)
{
LOG_ERROR("NetworkServer: recv_select failed receiving header, closing listener");
LOG_ERROR("[NetworkServer] recv_select failed receiving header, closing listener");
goto listen_done;
}
@ -623,7 +623,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
if(tmp_bytes_read <= 0)
{
LOG_ERROR("NetworkServer: recv_select failed receiving data, closing listener");
LOG_ERROR("[NetworkServer] recv_select failed receiving data, closing listener");
goto listen_done;
}
bytes_read += tmp_bytes_read;
@ -715,7 +715,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
}
else
{
LOG_ERROR("NetworkServer: UpdateLEDs packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
LOG_ERROR("[NetworkServer] UpdateLEDs packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
goto listen_done;
}
break;
@ -752,7 +752,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
}
else
{
LOG_ERROR("NetworkServer: UpdateZoneLEDs packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
LOG_ERROR("[NetworkServer] UpdateZoneLEDs packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
goto listen_done;
}
break;
@ -781,7 +781,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
}
else
{
LOG_ERROR("NetworkServer: UpdateSingleLED packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, (sizeof(int) + sizeof(RGBColor)));
LOG_ERROR("[NetworkServer] UpdateSingleLED packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, (sizeof(int) + sizeof(RGBColor)));
goto listen_done;
}
break;
@ -821,7 +821,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
}
else
{
LOG_ERROR("NetworkServer: UpdateMode packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
LOG_ERROR("[NetworkServer] UpdateMode packet has invalid size. Packet size: %d, Data size: %d", header.pkt_size, *((unsigned int*)data));
goto listen_done;
}
break;