Пример #1
0
    private void SaveToSQL(string label, bool clear)
    {
        if (!enableMySQLSave)
        {
            return;
        }

        if (!logsList.ContainsKey(label))
        {
            Debug.LogError("Could not find collection " + label + ". Aborting.");
            logsList[label].RemoveSavingTarget(TargetType.MySql);
            return;
        }

        if (logsList[label].RowCount == 0)
        {
            Debug.LogError("Collection " + label + " is empty. Aborting.");
            logsList[label].RemoveSavingTarget(TargetType.MySql);
            return;
        }

        connectToMySQL.AddToUploadQueue(logsList[label], label);
        connectToMySQL.UploadNow(() =>
        {
            logsList[label].RemoveSavingTarget(TargetType.MySql);
            logsList[label].TargetsSaved[TargetType.MySql] = true;
            SaveCallback(logsList[label], clear);
        });
    }
Пример #2
0
    // TODO: Write to log file on disk as backup

    public void UploadLogs()
    {
        mySQL.AddToUploadQueue(logCollection);
        mySQL.UploadNow();
        foreach (string key in logCollection.Keys)
        {
            Debug.Log("Key: " + key + ", Count: " + logCollection[key].Count.ToString());
            logCollection[key].Clear();
        }
    }
Пример #3
0
    public void sendLogs()                           //Send the logs
    {
        if (logs["Email"].Count == 0)
        {
            return;
        }

        connectToMySQL.AddToUploadQueue(logs);          //
        connectToMySQL.UploadNow();                     //

        resetLogs();
    }
Пример #4
0
    private void SaveToSQL(string label)
    {
        if (!enableMySQLSave)
        {
            return;
        }

        if (!collections.ContainsKey(label))
        {
            Debug.LogError("Could not find collection " + label + ". Aborting.");
            return;
        }

        if (collections[label].log.Keys.Count == 0)
        {
            Debug.LogError("Collection " + label + " is empty. Aborting.");
            return;
        }

        connectToMySQL.AddToUploadQueue(collections[label].log, collections[label].label);
        connectToMySQL.UploadNow();
    }