/// <summary> /// Writes a log entry to the output. /// </summary> /// <param name="entry">Log entry to be written.</param> /// <param name="NewLineAtEnd">If set to true, ends the current line and eventually write a newline char if supported by the underlying support.</param> protected override void Write(ILogEntry entry, bool NewLineAtEnd) { if (NewLineAtEnd) { Console.WriteLine(entry.ToString()); } else { Console.Write(entry.ToString()); } }
private void Instance_EntryLogged(ILogger logger, ILogEntry entry) { if (entry.Type > LogEntryTypes.Info && entry.Notification == LogEntryNotifications.Local) { ShowOverlayNotification(entry.ToString(), entry.Type >= LogEntryTypes.Warning); } }
private void LogEntry(ILogEntry entry) { lock (this.writer) { this.writer.WriteLine(entry.ToString()); } }
private void AddEntryUnlocked(ILogEntry entry) { string logEntry = entry.ToString(); if (EnableLogging) { try { using (StreamWriter sw = new StreamWriter(LOG_FILE, true)) { sw.WriteLine(logEntry); } } catch { } Console.WriteLine(logEntry); } }
private void btnLog_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("Event", typeof(string)); for (int i = 0; i < Log.LogEntries.Count; i++) { ILogEntry logEntry = Log.LogEntries[i]; dt.Rows.Add(logEntry.ToString()); } using (LogViewer logViewer = new LogViewer() { DataSource = dt }) { logViewer.ShowDialog(this); } }
public void WriteEntry(ILogEntry entry) { System.Console.WriteLine(entry.ToString().Replace(Environment.NewLine, "\n")); }
public void WriteEntry(ILogEntry entry) { this.writer.WriteLine(entry.ToString()); }
private void AddEntryUnlocked(ILogEntry entry) { LogEntries.Add(entry); Console.WriteLine(entry.ToString()); }
private void LogEntry(ILogEntry entry) => System.Console.WriteLine(entry.ToString().Replace(Environment.NewLine, "\n"));
/// <summary> /// Logs the specified log entry. /// </summary> /// <param name="entry">The entry to log.</param> /// <inheritdoc /> public override void LogEntry(ILogEntry entry) { entry.Source = SourceType.Name; Debug.WriteLine(entry.ToString()); }
/// <summary> /// Logs the specified log entry. /// </summary> /// <param name="entry">The entry to log.</param> public override void Log(ILogEntry entry) { entry.Source = SourceType.Name; Debug.WriteLine(entry.ToString()); }