public void WriteLine(LogEntry entry) { Color logColor; switch (entry.Type) { case LogType.Error: logColor = Color.Red; break; case LogType.Warning: logColor = Color.OrangeRed; break; case LogType.Information: logColor = Color.SteelBlue; break; case LogType.Good: logColor = Color.ForestGreen; break; case LogType.Normal: default: logColor = Color.Black; break; } rbLogBox.Invoke((Action)(() => { rbLogBox.SelectionColor = logColor; rbLogBox.AppendText(entry.FormattedMessage + Environment.NewLine); rbLogBox.ScrollToCaret(); })); }
public static void WriteLine(LogType type, string text, params object[] args) { var entry = new LogEntry(type, DateTime.Now, string.Format(text, args)); LogContent.AddLast(entry); foreach (ILog LogReader in LogReaders) LogReader.WriteLine(entry); }
public void WriteLine(LogEntry entry) { sw.WriteLine("[" + entry.Type.ToString().ToUpper() + "] " + entry.FormattedMessage); }