public void SetUp() { lmi = new LogMessageInfo("Info"); lmd = new LogMessageDebug("Debug"); lme = new LogMessageError("Error"); lmw = new LogMessageWarning("Warning"); lm = new LogMessage("Empty"); }
/// <summary> /// Adds the a new log to the list. /// </summary> /// <param name="log">The new log.</param> public void Add(LogMessage log) { this.logs.Add(log); if (this.type.Equals(LoggerEnum.AllString.ToString()) || log.Type.Equals(this.type)) { if (this.Scroll != null && this.Scroll.VerticalOffset == this.Scroll.ScrollableHeight) { this.show.Add(log); this.ScrollToBottom(); } else { this.show.Add(log); } } if (this.Logs.Count > this.max) { this.logs.RemoveAt(0); } }
private void WriteLine(LogMessage log) { if (AllowLogging) { string line = log.Time + "<span style='color:" + log.Color + ";'><b> " + log.Type + "</b></span> " + log.Text + "<br/>"; this.WriteLine(this.writerCurrent, line); this.WriteLine(this.writerStore, line); Console.WriteLine(log.Time + " " + log.Type + " " + log.Text); LogPanel.Add(log); } }