DebugLog.cs 697 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class DebugLog {
  5. private string logString;
  6. private string stackTrace;
  7. private LogType logType;
  8. public static int ct = 0;
  9. private int curIndex = 0;
  10. public DebugLog(string logStr, string sTrace, LogType lType)
  11. {
  12. this.logString = logStr;
  13. this.stackTrace = sTrace;
  14. this.logType = lType;
  15. curIndex = ct;
  16. ct++;
  17. }
  18. public override string ToString()
  19. {
  20. if (this.logString.Length > 300) {
  21. return this.logString.Substring (0, Mathf.Min (this.logString.Length - 1, 300)) + " ## " + curIndex;
  22. } else {
  23. return this.logString + " ## " + curIndex;
  24. }
  25. }
  26. }