public void Format(LogEvent logEvent, TextWriter output) { var included = logEvent.Properties .Where(a => !TemplateContainsPropertyName(logEvent.MessageTemplate, a.Key) && !TemplateContainsPropertyName(_messageTemplate, a.Key)) .Select(a => new LogEventProperty(a.Key, a.Value)); AnsiEscapeCodeFormatter.Format(output, string.Join(",", included.Select(a => $"{a.Name}: {a.Value}")), _propertyToken.Alignment); }
public void Format(LogEvent logEvent, TextWriter output) { if (!logEvent.Properties.TryGetValue(_propertyToken.PropertyName, out var logEventPropertyValue)) { return; } var writer = new StringWriter(); logEventPropertyValue.Render(writer, _propertyToken.Format); AnsiEscapeCodeFormatter.Format(output, writer.ToString(), _propertyToken.Alignment); }
public void Format(LogEvent logEvent, TextWriter output) { AnsiEscapeCodeFormatter.Format(output, _text); }