Esempio n. 1
0
        public Task WriteAsync(IEnumerable <LogEvent> events)
        {
            var payloadBuilder = new StringBuilder();

            Assert.DoesNotThrow(() => {
                foreach (var logEvent in events)
                {
                    payloadBuilder.Append(_apiKey).Append(' ');
                    var formatted = _formatter.FormatMessage(logEvent);
                    Assert.IsNotEmpty(formatted);
                    payloadBuilder.Append(formatted);
                    payloadBuilder.Append('\n');
                }
            });
            var payload = payloadBuilder.ToString();

            Assert.IsNotEmpty(payload);


            return(Task.CompletedTask);
        }
Esempio n. 2
0
 private void Log(string message)
 {
     _logBuilder.AppendLine(LogFormatter.FormatMessage(message));
 }
Esempio n. 3
0
 public void LogInfo(string message)
 {
     _logger.LogInformation(message);
     _resultBuilder.AppendLine(LogFormatter.FormatMessage(message));
 }