Handles writing diagnostic events to text output.
More...
|
| 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.
|
| |
| static async ValueTask | WriteAsync (int id, DiagnosticLevel level, string message, object?[] args, Exception? exception, DiagnosticLocation location, TextWriter writer, CancellationToken cancellationToken) |
| | Writes the given event data to the specified StringWriter.
|
| |
| static void | Write< TWriter > (int id, DiagnosticLevel level, string message, object?[] args, Exception? exception, DiagnosticLocation location, ref TWriter writer, Encoding? encoding=null) |
| | Writes the given event data to the specified IBufferWriter<byte>.
|
| |
Handles writing diagnostic events to text output.
Definition at line 17 of file TextDiagnosticFormat.cs.
◆ Write()
| static void IKVM.CoreLib.Diagnostics.TextDiagnosticFormat.Write |
( |
int | id, |
|
|
DiagnosticLevel | level, |
|
|
string | message, |
|
|
object?[] | args, |
|
|
Exception? | exception, |
|
|
DiagnosticLocation | location, |
|
|
TextWriter | writer ) |
|
static |
Writes the given event data to the specified StringWriter.
- Parameters
-
| id | |
| level | |
| message | |
| args | |
| exception | |
| location | |
| writer | |
Definition at line 30 of file TextDiagnosticFormat.cs.
31 {
32 var buffer = MemoryPool<byte>.Shared.Rent(65535);
33
34 try
35 {
37 Write(
id, level, message, args, exception, location,
ref wrt, writer.Encoding);
38 writer.Write(writer.Encoding.GetString(buffer.Memory.Span[..wrt.WrittenCount]));
39 }
40 finally
41 {
42 buffer.Dispose();
43 }
44 }
Implements the IBufferWriter<T> interface around a Memory<T>.
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.
◆ Write< TWriter >()
Writes the given event data to the specified IBufferWriter<byte>.
- Template Parameters
-
- Parameters
-
| id | |
| level | |
| message | |
| args | |
| exception | |
| location | |
| writer | |
| encoding | |
- Type Constraints
-
| TWriter | : | IBufferWriter<byte> | |
Definition at line 85 of file TextDiagnosticFormat.cs.
86 : IBufferWriter<byte>
87 {
89 WriteDiagnosticEvent(
ref encoder,
id, level, message, args, exception, location);
90 }
Provides an interface to write text to a IBufferWriter<byte>.
◆ WriteAsync()
| static async ValueTask IKVM.CoreLib.Diagnostics.TextDiagnosticFormat.WriteAsync |
( |
int | id, |
|
|
DiagnosticLevel | level, |
|
|
string | message, |
|
|
object?[] | args, |
|
|
Exception? | exception, |
|
|
DiagnosticLocation | location, |
|
|
TextWriter | writer, |
|
|
CancellationToken | cancellationToken ) |
|
static |
Writes the given event data to the specified StringWriter.
- Parameters
-
| id | |
| level | |
| message | |
| args | |
| exception | |
| location | |
| writer | |
| cancellationToken | |
Definition at line 57 of file TextDiagnosticFormat.cs.
58 {
59 var buffer = MemoryPool<byte>.Shared.Rent(65535);
60
61 try
62 {
64 Write(
id, level, message, args, exception, location,
ref wrt, writer.Encoding);
65 await writer.WriteAsync(writer.Encoding.GetString(buffer.Memory.Span[..wrt.WrittenCount]));
66 }
67 finally
68 {
69 buffer.Dispose();
70 }
71 }
The documentation for this class was generated from the following file: