Class MemoryTraceWriter
Represents a trace writer that writes to memory. When the trace message limit is reached then old trace messages will be removed as new messages are added.
Inheritance
Implements
Inherited Members
Namespace: Bayat.Json.Serialization
Assembly: Bayat.Json.Runtime.dll
Syntax
public class MemoryTraceWriter : ITraceWriter
Constructors
| Improve this Doc View SourceMemoryTraceWriter()
Initializes a new instance of the MemoryTraceWriter class.
Declaration
public MemoryTraceWriter()
Properties
| Improve this Doc View SourceLevelFilter
Gets the System.Diagnostics.TraceLevel that will be used to filter the trace messages passed to the writer. For example a filter level of
Info
will exclude Verbose
messages and include Info
,
Warning
and Error
messages.
Declaration
public TraceLevel LevelFilter { get; set; }
Property Value
Type | Description |
---|---|
System.Diagnostics.TraceLevel | The System.Diagnostics.TraceLevel that will be used to filter the trace messages passed to the writer. |
Methods
| Improve this Doc View SourceGetTraceMessages()
Returns an enumeration of the most recent trace messages.
Declaration
public IEnumerable<string> GetTraceMessages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | An enumeration of the most recent trace messages. |
ToString()
Returns a System.String of the most recent trace messages.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String of the most recent trace messages. |
Overrides
Trace(TraceLevel, String, Exception)
Writes the specified trace level, message and optional exception.
Declaration
public void Trace(TraceLevel level, string message, Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.TraceLevel | level | The System.Diagnostics.TraceLevel at which to write this trace. |
System.String | message | The trace message. |
System.Exception | ex | The trace exception. This parameter is optional. |