/// <summary> /// Writes into the ConcurrentQueue the Message specified /// </summary> /// <param name="message">The message to write to the log</param> public void WriteToLog(string message) { lock (_logQueue) { var logEntry = new LogInfo(message); _logQueue.Enqueue(logEntry); if (_logQueue.Any()) { FlushLog(); } } }
/// <summary> /// Writes into the ConcurrentQueue the Entry specified /// </summary> /// <param name="logEntry">The logEntry to write to the log</param> public void WriteToLog(LogInfo logEntry) { lock (_logQueue) { _logQueue.Enqueue(logEntry); if (_logQueue.Any()) { FlushLog(); } } }
private static void PrintLog(LogInfo li) { _writer.WriteToLog(li); }