Provides a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source.
Constructors | |
| trace_source (const xtd::ustring &name) | |
| Initializes a new instance of the Trace_Source class, using the specified name for the source. More... | |
| trace_source (const xtd::ustring &name, xtd::diagnostics::source_levels default_levels) | |
| Initializes a new instance of the Trace_Source class, using the specified name for the source. More... | |
Properties | |
| xtd::diagnostics::trace_listener_collection & | listeners () noexcept |
| Gets the collection of trace listeners for the trace source. More... | |
| void | listeners (const xtd::diagnostics::trace_listener_collection &listeners) noexcept |
| Sets the collection of trace listeners for the trace source. More... | |
| const xtd::ustring & | name () const noexcept |
| Gets the name of the trace source. More... | |
| const xtd::diagnostics::source_switch & | source_switch () const noexcept |
| Gets the source switch value. More... | |
| void | source_switch (const xtd::diagnostics::source_switch &source_switch) noexcept |
| Sets the source switch value. More... | |
Methods | |
| 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... | |
| template<typename object_t > | |
| void | trace_data (const xtd::diagnostics::trace_event_type &event_type, int32 id, const object_t &data) |
| Writes trace data to the trace listeners in the Listeners collection using the specified event type, event identifier, and trace data. More... | |
| template<typename object_t > | |
| void | trace_data (const xtd::diagnostics::trace_event_type &event_type, int32 id, const std::vector< object_t > &data) |
| Writes trace data to the trace listeners in the Listeners collection using the specified event type, event identifier, and trace data. More... | |
| void | trace_event (const xtd::diagnostics::trace_event_type &event_type, int32 id) |
| Writes a trace event message to the trace listeners in the listeners collection using the specified event type and event identifier. More... | |
| void | trace_event (const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &message) |
| Writes a trace event message to the trace listeners in the listeners collection using the specified event type, event identifier adn message. More... | |
| template<typename ... objects> | |
| void | trace_event (const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &format, const objects &... args) |
| Writes a trace event message to the trace listeners in the listeners collection using the specified event type, event identifier, and argument array and format. More... | |
| void | trace_information (const xtd::ustring &message) |
| Writes an informational message to the trace listeners in the listeners collection using the specified message. More... | |
| template<typename ... objects_t> | |
| void | trace_information (const xtd::ustring &format, const objects_t &... args) |
| Writes an informational message to the trace listeners in the listeners collection using the specified object array and formatting information. More... | |
| template<typename guid_t > | |
| void | trace_transfer (int32 id, const xtd::ustring &message, const guid_t &related_activity_id) |
| Writes a trace transfer message to the trace listeners in the listeners collection using the specified numeric identifier, message, and related activity identifier. More... | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
| virtual xtd::ustring | to_string () const noexcept |
| Returns a sxd::ustring that represents the current object. More... | |
Static Public Member Functions inherited from xtd::object | |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
|
explicit |
Initializes a new instance of the Trace_Source class, using the specified name for the source.
| name | The name of the source (typically, the name of the application). |
|
explicit |
Initializes a new instance of the Trace_Source class, using the specified name for the source.
| name | The name of the source (typically, the name of the application). |
| default_level | A bitwise combination of the enumeration values that specifies the default source level at which to trace |
| void xtd::diagnostics::trace_source::close | ( | ) |
Closes all the trace listeners in the trace listener collection.
| void xtd::diagnostics::trace_source::flush | ( | ) |
Flushes all the trace listeners in the trace listener collection.
|
noexcept |
Gets the collection of trace listeners for the trace source.
|
noexcept |
Sets the collection of trace listeners for the trace source.
| listeners | A trace_listener_collection that contains the active trace listeners associated with the source. |
|
noexcept |
Gets the name of the trace source.
|
noexcept |
Gets the source switch value.
|
noexcept |
Sets the source switch value.
| source_switch | A SourceSwitch object representing the source switch value. |
|
inline |
Writes trace data to the trace listeners in the Listeners collection using the specified event type, event identifier, and trace data.
| event_type | 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. |
|
inline |
Writes trace data to the trace listeners in the Listeners collection using the specified event type, event identifier, and trace data.
| event_type | 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. |
|
inline |
Writes a trace event message to the trace listeners in the listeners collection using the specified event type and event identifier.
| event_type | One of the enumeration values that specifies the event type of the trace data. |
| id | A numeric identifier for the event. |
|
inline |
Writes a trace event message to the trace listeners in the listeners collection using the specified event type, event identifier adn message.
| event_type | 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. |
|
inline |
Writes a trace event message to the trace listeners in the listeners collection using the specified event type, event identifier, and argument array and format.
| event_type | 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 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. |
| void xtd::diagnostics::trace_source::trace_information | ( | const xtd::ustring & | message | ) |
Writes an informational message to the trace listeners in the listeners collection using the specified message.
| message | The informative message to write. |
|
inline |
Writes an informational message to the trace listeners in the listeners collection using the specified object array and formatting information.
| format | A composite format string 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. |
|
inline |
Writes a trace transfer message to the trace listeners in the 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. |
| related_activity_id | A structure that identifies the related activity. |