public Task SendLog(IQueue queue) { var log = _formatter.Format(queue); if (!string.IsNullOrWhiteSpace(log)) { Console.WriteLine(nameof(LogSender) + " - " + log); } return(Task.CompletedTask); }
/// <summary> /// Write log to file if nto empty /// </summary> public void WriteLog(IQueue queue) { var log = _formatter.Format(queue); if (!string.IsNullOrWhiteSpace(log)) { lock (_fileLock){ using var stream = GetStream(queue.Time.DateTime); stream.WriteLine(log); } } }