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(); } }
/* * 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); }
private void Update() { Debug.Log("Connection Status: " + DataAnalyticsStructure.GetConnectedState()); }