/// <summary> /// Called whenever a new item is added to the registered log. Writes the log message /// to the system console. /// </summary> /// <param name="item">Details of newly-added log item</param> public override void ProcessLogMessage(LogItem item) { Console.WriteLine(item.ToString()); }
/// <summary> /// Called whenever a new item is added to the registered log. Adds the LogItem /// to the assocaited ListBox control. /// </summary> /// <param name="item">Details of newly-added log item</param> public override void ProcessLogMessage(LogItem item) { this.AddMessageToListBox(item.ToString(" ")); }
/// <summary> /// Called whenever a new item is added to the registered log. Adds the LogItem /// to the assocaited log file, creating the log file/path if needed. File writes /// are performed on a seperate thread so that return is immediate. /// </summary> /// <param name="item">Details of newly-added log item</param> public override void ProcessLogMessage(LogItem item) { lock (_fileSync) { if ((_logWriterThread == null) && (!String.IsNullOrEmpty(_filePath))) { _logWriterThread = new Thread(AddMessagesToFile); _logWriterThread.IsBackground = true; _logWriterThread.Name = "FileLog Listener: " + _filePath; _logWriterThread.Start(); } if (item != null) _logMessages.Enqueue(item.ToString(" ")); Monitor.Pulse(_fileSync); } }
/// <summary> /// Called whenever a new item is added to the registered log. Adds the LogItem /// to the assocaited ListBox control. /// </summary> /// <param name="item">Details of newly-added log item</param> public override void ProcessLogMessage(LogItem item) { this.ShowMessage(item.ToString(" "), item.Level.ToString()); }
/// <summary> /// Virtual method called whenever a new item is added to the registered log. /// Base method simply writes the item message and level to the Visual Studio Debug output; /// derived classes should override this method to do something more exotic. /// </summary> /// <param name="item">Details of newly-added log item</param> public virtual void ProcessLogMessage(LogItem item) { System.Diagnostics.Debug.WriteLine(item.ToString()); }