/// <summary> /// Main method to add a Log to the system /// </summary> /// <param name="inText">Message to Add as Log</param> /// <param name="inSeverity">Severity of the log (used in Filters and to set its Color + some specific treatment for "LogSeverities.Error")</param> public static void Log(string inText, LogSeverities inSeverity) { if (instance != null) { instance._logs.Add(new Log(inText, inSeverity)); if (instance.maxLines > 0 && instance._logs.Count > instance.maxLines) { instance._logs.RemoveAt(0); } instance.OnLogAdd(instance, new EventArgs()); } else { throw new Exception("Logger instance not created, please use \"logUCtrl.Bind(Logger.GetInstance());\" to bind the singleton."); } }
public Log(string intext, LogSeverities inSeverity) { text = intext; severity = inSeverity; time = DateTime.Now; }