30 var encoding = channel.Encoding ?? Encoding.UTF8;
31 using var buffer = MemoryPool<byte>.Shared.Rent(65535);
33 TextDiagnosticFormat.
Write(@event.Diagnostic.Id, @event.Diagnostic.Level, @event.Diagnostic.Message, @event.Args, @event.Exception, @event.Location,
ref writer, encoding);
34 WriteLine(writer, encoding);
45 var buf = (Span<byte>)stackalloc
byte[8];
46 var len = encoding.GetBytes(Environment.NewLine, buf);
47 writer.Write(buf[..len]);
Implements the IBufferWriter<T> interface around a Memory<T>.
Handles writing diagnostic events to text output.
static void Write(int id, DiagnosticLevel level, string message, object?[] args, Exception? exception, DiagnosticLocation location, TextWriter writer)
Writes the given event data to the specified StringWriter.
Handles writing diagnostic events to text output.
TextDiagnosticFormatter(TextDiagnosticFormatterOptions options)
Initializes a new instance.
override void WriteImpl(in DiagnosticEvent @event, IDiagnosticChannel channel)