private void Stop() { // if LogList is populated and we have a connection if (LogList.Count > 0 && DataAnalytics.GetConnectedState()) { // For each element in LogList, send a request to DataAnalytics for Log Sending foreach (string temp in LogList) { DataAnalytics.AddLog(temp); } } // Else if LogList is populated and we do not have a connection else if (LogList.Count > 0 && DataAnalyticsStructure.GetConnectedState()) { // For each element in LogList, send a request to LogLoader for Local Saving foreach (string temp in LogList) { LogLoader.WriteLogLocal(filePath, temp); } // Clear LogList LogList.Clear(); } }
private void test() { DataAnalyticsStructure.AddLog(firstTestMessage); DataAnalyticsStructure.AddLogList(multipleLogEntryExample); DataAnalyticsStructure.AddLog("I THINK IT WORKED?"); DataAnalyticsStructure.PostLogs(); }
/* * This function will send all logs within the logList while emptying the queue in the process. * These logs are sent to the Logstash Client running on the server end. */ public static Queue <string> PostAllLogs(UDPThreaded Connection, Queue <string> LogList) { if (DataAnalyticsStructure.GetPostRequestState() && DataAnalyticsStructure.GetConnectedState() && LogList != null && LogList.Count >= 1) { while (LogList.Count > 0 && Connection != null) { Connection.Send(LogList.Dequeue()); } } return(LogList); }
void Start() { multipleLogEntryExample.Add("This"); multipleLogEntryExample.Add("serves"); multipleLogEntryExample.Add("As"); multipleLogEntryExample.Add("An"); multipleLogEntryExample.Add("Example"); multipleLogEntryExample.Add("Of"); multipleLogEntryExample.Add("Batched"); multipleLogEntryExample.Add("Log"); multipleLogEntryExample.Add("Sending"); DataAnalyticsStructure.SetPostRequest(true); // Mimic the send logs button from the User test(); }
private void Update() { Debug.Log("Connection Status: " + DataAnalyticsStructure.GetConnectedState()); }