/// <summary> /// Initializes a new instance of the <see cref="LogEntry"/> class. /// </summary> /// <param name="text">The text.</param> /// <param name="severity">The severity.</param> /// <param name="source">The source.</param> public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source) { this.logText = text; this.logStamp = DateTime.Now; this.Severity = severity; this.Source = source; }
/// <summary> /// Initializes a new instance of the <see cref="LogEntry" /> class. /// </summary> /// <param name="text">The text.</param> /// <param name="severity">The severity.</param> /// <param name="source">The source.</param> /// <param name="path">The path where something happened</param> public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source, string path) { LogText = text; LogStamp = DateTime.Now; Severity = severity; Source = source; Path = path; }
public LogEntry(string message, LogEntryType type, LogEntrySource sourceName, string extraSourceInfo) { Message = message; SourceName = sourceName; ExtraSourceInfo = extraSourceInfo; Type = type; Date = DateTime.Now; }
public static void Write(string message, LogEntryType type, LogEntrySource source, string extraSourceInfo) { var newEntry = new LogEntry(message, type, source, extraSourceInfo); lock (LogEntryBackingList) { LogEntryBackingList.Add(newEntry); TrimLogList(); } OnEntryAdded(newEntry); }
/// <summary> /// Logs the specified text. This is marshalled to the UI thread if necessary. /// </summary> /// <param name="text">The text.</param> /// <param name="severity">The severity.</param> /// <param name="source">The source.</param> private void Log(string text, LogEntrySeverity severity, LogEntrySource source) { if (String.IsNullOrEmpty(text)) { return; } this.MarshallMethod(() => { //Hack to catch error messages from the converter if (text.StartsWith("Error: ")) { this.Options.Logger.AddLogEntry(new LogEntry(text, LogEntrySeverity.Error, LogEntrySource.Converter)); return; } this.Options.Logger.AddLogEntry(new LogEntry(text, severity, source)); }, DispatcherPriority.Send); }
public static void Write(string message, LogEntryType type, LogEntrySource source) { Write(message, type, source, string.Empty); }
public static void Write(string message, LogEntryType type, LogEntrySource source, string extraSourceInfo) { var newEntry = new LogEntry(message, type, source, extraSourceInfo); lock (LogEntryList) { LogEntryList.Add(newEntry); TrimLogList(); } OnEntryAdded(newEntry); }
/// <summary> /// Initializes a new instance of the <see cref="LogEntry" /> class. /// </summary> /// <param name="text">The text.</param> /// <param name="severity">The severity.</param> /// <param name="source">The source.</param> public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source) : this(text, severity, source, string.Empty) { }