Logging improvment - GUI and log file shall be much easier to read and contain more information

This commit is contained in:
szporowolik
2019-10-21 17:50:04 +02:00
parent 5889bc6ddf
commit 5908f8f332
4 changed files with 81 additions and 69 deletions

View File

@@ -126,7 +126,7 @@ public class TCPController
if (Int32.Parse(strRawTCPFrameType) != 0)
{
// Add to mySQL send buffer (find first empty slot)
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP packet received, type: " + strRawTCPFrameType, 2);
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Packet received" , 2,0, strRawTCPFrameType,true);
for (int i = 0; i < arrMySQLSendBuffer.Length - 1; i++)
{
if (arrMySQLSendBuffer[i] == null)
@@ -138,7 +138,7 @@ public class TCPController
} else
{
// Keep alive
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Keep-alive received", 2);
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Keep-alive received", 2,0,"0",true);
}
}
else
@@ -150,7 +150,7 @@ public class TCPController
{
Globals.intGameErros++;
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "ERROR while message parsing , error: " + e.Message,2,1);
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "ERROR while message parsing , error: " + e.Message,2,1,"?");
bTCPConnectionOnline = false;
}
@@ -162,7 +162,7 @@ public class TCPController
catch (SocketException e)
{
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP ERROR cannot check connection, error: " + e.Message,2,1);
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP ERROR cannot check connection, error: " + e.Message,2,1,"?");
}
}
@@ -176,7 +176,7 @@ public class TCPController
{
Globals.intGameErros++;
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP error - connection closed or port in use, error: " + e.Message,1,1);
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP error - connection closed or port in use, error: " + e.Message,1,1,"?");
bTCPConnectionOnline = false;
}