Ejemplo n.º 1
0
 //Clears all the logs
 public void Clear()
 {
     //if IsReadOnly is true, it is impossible to clear the logs
     if (IsReadOnly())
     {
         Debug.LogError("Impossible to clear the log " + Label + " while saving it");
         return;
     }
     if (isLogStringReady)
     {
         isLogStringReady = false;
     }
     logs.Clear();
     CurrentLogRow.Clear();
     logString.Clear();
     RowCount = 0;
     Debug.Log("Log " + Label + " cleared");
 }
Ejemplo n.º 2
0
    //Terminates the current row
    public void EndRow()
    {
        if (LogType == LogType.OneRowOverwrite && RowCount >= 1)
        {
            Debug.Log("Unable to log more than one row in OneRowOverwrite mode");
            return;
        }
        AddCommonColumns();
        foreach (var logsKey in logs.Keys)
        {
            if (!CurrentLogRow.ContainsKey(logsKey))
            {
                CurrentLogRow.Add(logsKey, "NULL");
            }
        }
        foreach (var pair in CurrentLogRow)
        {
            CreateOrAddToLogsDict(logs, pair.Key, pair.Value);
            if (createStringOverTime)
            {
                if (currentLineLogged.Length != 0)
                {
                    currentLineLogged.Append(fieldSeparator);
                }
                currentLineLogged.Append(pair.Value);
            }
        }

        if (createStringOverTime)
        {
            currentLineLogged.Append(lineSeparator);
            logString.Append(currentLineLogged);
            currentLineLogged.Clear();
        }
        CurrentLogRow.Clear();
        RowCount++;
    }