mscorlib(4.0.0.0) API with additions
|
Provides a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source. More...
Public Member Functions | |
TraceSource (string name) | |
Initializes a new instance of the T:System.Diagnostics.TraceSource class, using the specified name for the source. More... | |
TraceSource (string name, SourceLevels defaultLevel) | |
Initializes a new instance of the T:System.Diagnostics.TraceSource class, using the specified name for the source and the default source level at which tracing is to occur. More... | |
void | Close () |
Closes all the trace listeners in the trace listener collection. More... | |
void | Flush () |
Flushes all the trace listeners in the trace listener collection. More... | |
void | TraceEvent (TraceEventType eventType, int id) |
Writes a trace event message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type and event identifier. More... | |
void | TraceEvent (TraceEventType eventType, int id, string message) |
Writes a trace event message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and message. More... | |
void | TraceEvent (TraceEventType eventType, int id, string format, params object[] args) |
Writes a trace event to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and argument array and format. More... | |
void | TraceData (TraceEventType eventType, int id, object data) |
Writes trace data to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and trace data. More... | |
void | TraceData (TraceEventType eventType, int id, params object[] data) |
Writes trace data to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and trace data array. More... | |
void | TraceInformation (string message) |
Writes an informational message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified message. More... | |
void | TraceInformation (string format, params object[] args) |
Writes an informational message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified object array and formatting information. More... | |
void | TraceTransfer (int id, string message, Guid relatedActivityId) |
Writes a trace transfer message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified numeric identifier, message, and related activity identifier. More... | |
Public Attributes | |
string | Name => sourceName |
Gets the name of the trace source. More... | |
Protected Member Functions | |
virtual internal string [] | GetSupportedAttributes () |
Gets the custom attributes supported by the trace source. More... | |
Properties | |
StringDictionary | Attributes [get] |
Gets the custom switch attributes defined in the application configuration file. More... | |
TraceListenerCollection | Listeners [get] |
Gets the collection of trace listeners for the trace source. More... | |
SourceSwitch | Switch [get, set] |
Gets or sets the source switch value. More... | |
Provides a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source.
Definition at line 9 of file TraceSource.cs.
System.Diagnostics.TraceSource.TraceSource | ( | string | name | ) |
Initializes a new instance of the T:System.Diagnostics.TraceSource class, using the specified name for the source.
name | The name of the source (typically, the name of the application). |
T:System.ArgumentNullException | name is null . |
T:System.ArgumentException | name is an empty string (""). |
Definition at line 87 of file TraceSource.cs.
System.Diagnostics.TraceSource.TraceSource | ( | string | name, |
SourceLevels | defaultLevel | ||
) |
Initializes a new instance of the T:System.Diagnostics.TraceSource class, using the specified name for the source and the default source level at which tracing is to occur.
name | The name of the source, typically the name of the application. |
defaultLevel | A bitwise combination of the enumeration values that specifies the default source level at which to trace. |
T:System.ArgumentNullException | name is null . |
T:System.ArgumentException | name is an empty string (""). |
Definition at line 99 of file TraceSource.cs.
void System.Diagnostics.TraceSource.Close | ( | ) |
Closes all the trace listeners in the trace listener collection.
Definition at line 200 of file TraceSource.cs.
void System.Diagnostics.TraceSource.Flush | ( | ) |
Flushes all the trace listeners in the trace listener collection.
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 216 of file TraceSource.cs.
|
protectedvirtual |
Gets the custom attributes supported by the trace source.
null
if there are no custom attributes.Definition at line 252 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceData | ( | TraceEventType | eventType, |
int | id, | ||
object | data | ||
) |
Writes trace data to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and trace data.
eventType | One of the enumeration values that specifies the event type of the trace data. |
id | A numeric identifier for the event. |
data | The trace data. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 513 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceData | ( | TraceEventType | eventType, |
int | id, | ||
params object [] | data | ||
) |
Writes trace data to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and trace data array.
eventType | One of the enumeration values that specifies the event type of the trace data. |
id | A numeric identifier for the event. |
data | An object array containing the trace data. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 566 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceEvent | ( | TraceEventType | eventType, |
int | id | ||
) |
Writes a trace event message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type and event identifier.
eventType | One of the enumeration values that specifies the event type of the trace data. |
id | A numeric identifier for the event. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 349 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceEvent | ( | TraceEventType | eventType, |
int | id, | ||
string | message | ||
) |
Writes a trace event message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and message.
eventType | One of the enumeration values that specifies the event type of the trace data. |
id | A numeric identifier for the event. |
message | The trace message to write. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 402 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceEvent | ( | TraceEventType | eventType, |
int | id, | ||
string | format, | ||
params object [] | args | ||
) |
Writes a trace event to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified event type, event identifier, and argument array and format.
eventType | One of the enumeration values that specifies the event type of the trace data. |
id | A numeric identifier for the event. |
format | A composite format string (see Remarks) that contains text intermixed with zero or more format items, which correspond to objects in the args array. |
args | An object array containing zero or more objects to format. |
T:System.ArgumentNullException | format is null . |
T:System.FormatException | format is invalid.-or- The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 460 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceInformation | ( | string | message | ) |
Writes an informational message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified message.
message | The informative message to write. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 617 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceInformation | ( | string | format, |
params object [] | args | ||
) |
Writes an informational message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified object array and formatting information.
format | A composite format string (see Remarks) that contains text intermixed with zero or more format items, which correspond to objects in the args array. |
args | An array containing zero or more objects to format. |
T:System.ArgumentNullException | format is null . |
T:System.FormatException | format is invalid.-or- The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format. |
T:System.ObjectDisposedException | An attempt was made to trace an event during finalization. |
Definition at line 631 of file TraceSource.cs.
void System.Diagnostics.TraceSource.TraceTransfer | ( | int | id, |
string | message, | ||
Guid | relatedActivityId | ||
) |
Writes a trace transfer message to the trace listeners in the P:System.Diagnostics.TraceSource.Listeners collection using the specified numeric identifier, message, and related activity identifier.
id | A numeric identifier for the event. |
message | The trace message to write. |
relatedActivityId | A structure that identifies the related activity. |
Definition at line 641 of file TraceSource.cs.
string System.Diagnostics.TraceSource.Name => sourceName |
Gets the name of the trace source.
Definition at line 44 of file TraceSource.cs.
|
get |
Gets the custom switch attributes defined in the application configuration file.
Definition at line 30 of file TraceSource.cs.
|
get |
Gets the collection of trace listeners for the trace source.
Definition at line 49 of file TraceSource.cs.
|
getset |
Gets or sets the source switch value.
T:System.ArgumentNullException | P:System.Diagnostics.TraceSource.Switch is set to null . |
Definition at line 63 of file TraceSource.cs.