Interface ITraceWriter
Defines the interface for a class that provides methods to record an execution flow.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Diagnostics
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public interface ITraceWriter : IDisposable
Properties
IsEnabled
Gets flag indicating if tracing is enabled. If false then Write methods do nothing.
Declaration
bool IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
WriteCustomElement(string, string, IDictionary<string, string>)
Writes a custom XML element with provided name, text value, and attributes.
Declaration
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
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
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, params object[])
Writes the message indicating the failing of a component execution.
Declaration
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
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
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, params object[])
Writes an exception details to the log.
Declaration
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
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, params object[])
Writes an arbitrary log message.
Declaration
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
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
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
void WriteXml(string data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | data | XML string to be recorded. |