Class NullTraceWriter
Implements a trace writer that is disabled and does not perform any recording.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Diagnostics
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class NullTraceWriter : ITraceWriter, IDisposable
  Properties
Instance
Gets the singleton instance of the trace writer.
Declaration
public static NullTraceWriter Instance { get; }
  Property Value
| Type | Description | 
|---|---|
| NullTraceWriter | 
IsEnabled
Gets flag indicating if tracing is enabled. Always returns false.
Declaration
public bool IsEnabled { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
Methods
Dispose()
Releases the internal resources.
Declaration
public void Dispose()
  WriteCustomElement(String, String, IDictionary<String, String>)
Writes a custom XML element with provided name, text value, and attributes.
Declaration
public void WriteCustomElement(string name, string text, IDictionary<string, string> attributes = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | name | Element name.  | 
      
| String | text | Optional element text (string value).  | 
      
| IDictionary<String, String> | attributes | Optional collection of XML attributes where key is the attribute name, and the value is the attribute value.  | 
      
WriteEnd(TraceMark)
Writes the message indicating the ending of a component execution.
Declaration
public void WriteEnd(TraceMark startMark)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TraceMark | startMark | An object that was returned when the start message was recorded.  | 
      
WriteEnd(TraceMark, Exception, String, Object[])
Writes the message indicating the failing of a component execution.
Declaration
public void WriteEnd(TraceMark startMark, Exception exception, string message = null, params object[] args)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TraceMark | startMark | An object that was returned when the start message was recorded.  | 
      
| Exception | exception | An exception that component has failed with.  | 
      
| String | message | Optional message clarifying the error.  | 
      
| Object[] | args | Optional format parameters to the error message.  | 
      
WriteEnd(TraceMark, Object)
Writes the message indicating the ending of a component execution.
Declaration
public void WriteEnd(TraceMark startMark, object result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TraceMark | startMark | An object that was returned when the start message was recorded.  | 
      
| Object | result | The result of the component execution to be recorded.  | 
      
WriteError(Exception, String, Object[])
Writes an exception details to the log.
Declaration
public void WriteError(Exception exception, string message = null, params object[] args)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Exception | exception | Exception to be recorded.  | 
      
| String | message | Optional message clarifying the error.  | 
      
| Object[] | args | Optional format parameters to the error message.  | 
      
WriteMessage(String, Object[])
Writes an arbitrary log message.
Declaration
public void WriteMessage(string message, params object[] args)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | message | Message to be recorded.  | 
      
| Object[] | args | Optional format parameters to the log message.  | 
      
WriteStart(String, String)
Writes the message indicating the beginning of a component execution.
Declaration
public TraceMark WriteStart(string name, string id = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | name | Name of the executing component.  | 
      
| String | id | Optional identifier of the executing component.  | 
      
Returns
| Type | Description | 
|---|---|
| TraceMark | An object to be used for writing the ending of the component execution. It carries the component name and execution statistics.  | 
      
WriteXml(String)
Writes an XML string to the log.
Declaration
public void WriteXml(string data)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | data | XML string to be recorded.  |