public static void LastXMessages() { if (NLogger._msgs.Count < 1) { return; } StringBuilder stringBuilder = new StringBuilder(); int count = NLogger._msgs.Count; if (count > (int)NLogger.MaxMessages) { for (int i = count - (int)NLogger.MaxMessages; i < count; i++) { stringBuilder.Append(NLogger._msgs[i].message).AppendLine(); } } else { foreach (NLogger.Message current in NLogger._msgs) { stringBuilder.Append(current.message).AppendLine(); } } NLogger.Publish(new NLogger.Message(stringBuilder.ToString(), NLogger._errorState)); }
public static void LastMessage() { if (NLogger._msgs.Count < 1) { return; } NLogger.Publish(NLogger._msgs[NLogger._msgs.Count - 1]); }