Provides the abstract base class for the listeners who monitor trace and debug output.
Public Constructors | |
| trace_listener ()=default | |
| Initializes a new instance of the trace_listener class. | |
| trace_listener (const xtd::string &name) | |
| Initializes a new instance of the trace_listener class using the specified name as the listener. | |
Public Properties | |
| auto | indent_level () const noexcept -> xtd::uint32 |
| Gets the indent level. | |
| auto | indent_level (xtd::uint32 indent_level) noexcept -> void |
| Sets the indent level. | |
| auto | indent_size () const noexcept -> xtd::uint32 |
| Gets the number of spaces in an indent. | |
| auto | indent_size (xtd::uint32 indent_size) noexcept -> void |
| Sets the number of spaces in an indent. | |
| virtual auto | is_thread_safe () const noexcept -> bool |
| Gets a value indicating whether the trace listener is thread safe. | |
| auto | name () const noexcept -> const xtd::string & |
| Gets or sets a name for this TraceListener. | |
| auto | name (const xtd::string &name) noexcept -> void |
| Sets a name for this TraceListener. | |
| auto | trace_output_options () const noexcept -> xtd::diagnostics::trace_options |
| Gets the trace output options. | |
| auto | trace_output_options (xtd::diagnostics::trace_options trace_output_options) noexcept -> void |
| Sets the trace output options. | |
Public Methods | |
| virtual auto | close () -> void |
| When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output. | |
| virtual auto | fail (const xtd::string &message) -> void |
| Emits an error message to the listener you create when you implement the TraceListener class. | |
| virtual auto | fail (const xtd::string &message, const xtd::string &detail_message) -> void |
| Emits the specified error message. | |
| virtual auto | flush () -> void |
| When overridden in a derived class, flushes the output buffer. | |
| template<typename object_t> | |
| auto | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const object_t &data) -> void |
| Writes trace information, a data object and event information to the listener specific output. | |
| template<typename object_t> | |
| auto | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const xtd::array< object_t > &data) -> void |
| Writes trace information, a data object and event information to the listener specific output. | |
| template<typename ... objects_t> | |
| auto | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, objects_t &&... data) -> void |
| Writes trace information, an array of data objects and event information to the listener specific output. | |
| virtual auto | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id) -> void |
| Writes trace and event information to the listener specific output. | |
| virtual void | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::string &message) |
| Writes trace information, a message, and event information to the listener specific output. | |
| template<typename ... objects_t> | |
| auto | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const xtd::string &format, const objects_t &... args) -> void |
| Writes trace information, a formatted array of objects and event information to the listener specific output. | |
| template<typename guid_t> | |
| auto | trace_transfer (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, xtd::int32 id, const xtd::string &message, const guid_t &related_activity_id) -> void |
| Writes trace information, a message, a related activity identity and event information to the listener specific output. | |
| template<typename object_t> | |
| auto | write (const object_t &o) -> void |
| Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
| template<typename object_t> | |
| auto | write (const object_t &o, const xtd::string &category) -> void |
| Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
| virtual void | write (const xtd::string &message)=0 |
| Writes the message to the listener you create when you implement the trace_listener class. | |
| template<typename object_t> | |
| auto | write_line (const object_t &o) -> void |
| Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
| template<typename object_t> | |
| auto | write_line (const object_t &o, const xtd::string &category) -> void |
| Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
| virtual auto | write_line (const xtd::string &message) -> void=0 |
| Writes the message to the listener you create when you implement the trace_listener class followed by a line terminator.followed by a line terminator. | |
Protected Properties | |
| auto | need_indent () const noexcept -> bool |
| Gets a value indicating whether to indent the output. | |
| auto | need_indent (bool need_indent) noexcept -> void |
| Sets a value indicating whether to indent the output. | |
| auto | thread_safe (bool thread_safe) noexcept -> void |
| Sets a value indicating whether the trace listener is thread safe. | |
Protected Methods | |
| virtual auto | write_indent () -> void |
| Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. | |
| virtual xtd::size | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| virtual xtd::string | to_string () const |
| Returns a xtd::string that represents the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance. | |
| abstract_object ()=default | |
| Initializes a new instance of the xtd::abstract_object class. | |
|
default |
Initializes a new instance of the trace_listener class.
| Property | Default Value |
|---|---|
| name | The empty string (""). |
| indent_level | Zero. |
| indent_size | Four spaces. |
|
explicit |
Initializes a new instance of the trace_listener class using the specified name as the listener.
| name | The name of the trace_listener. |
|
nodiscardnoexcept |
Gets the indent level.
|
noexcept |
Sets the indent level.
| indent_level | The indent level. The default is zero. |
|
nodiscardnoexcept |
Gets the number of spaces in an indent.
|
noexcept |
Sets the number of spaces in an indent.
| int32 | The number of spaces in an indent. The default is four spaces. |
|
nodiscardvirtualnoexcept |
Gets a value indicating whether the trace listener is thread safe.
|
nodiscardnoexcept |
Gets or sets a name for this TraceListener.
|
noexcept |
Sets a name for this TraceListener.
| name | A name for this TraceListener. The default is an empty string (""). |
|
nodiscardnoexcept |
Gets the trace output options.
|
noexcept |
Sets the trace output options.
| trace_output_options | A bitwise combination of the enumeration values. The default is None. |
|
virtual |
When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
Reimplemented in xtd::diagnostics::default_trace_listener, xtd::diagnostics::ostream_trace_listener, and xtd::forms::control_trace_listener.
|
inlinevirtual |
Emits an error message to the listener you create when you implement the TraceListener class.
| message | A message to emit. |
|
inlinevirtual |
Emits the specified error message.
| message | A message to emit. |
| detail_message | A detailed message to emit. |
|
inlinevirtual |
When overridden in a derived class, flushes the output buffer.
Reimplemented in xtd::diagnostics::default_trace_listener, xtd::diagnostics::ostream_trace_listener, and xtd::forms::control_trace_listener.
|
inline |
Writes trace information, a data object and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| event_type | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
| data | The trace data to emit. |
|
inline |
Writes trace information, a data object and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| event_type | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
| data | The trace data to emit. |
|
inline |
Writes trace information, an array of data objects and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| eventType | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
| data | An array of objects to emit as data. |
|
inlinevirtual |
Writes trace and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| eventType | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
|
inlinevirtual |
Writes trace information, a message, and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| eventType | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
| message | A message to write. |
|
inline |
Writes trace information, a formatted array of objects and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| eventType | One of the TraceEventType values specifying the type of event that has caused the trace. |
| id | A numeric identifier for the event. |
| format | A format string that contains zero or more format items, which correspond to objects in the args array. |
| args | An object array containing zero or more objects to format. |
|
inline |
Writes trace information, a message, a related activity identity and event information to the listener specific output.
| event_cache | A trace_event_cache object that contains the current process ID, thread ID, and stack trace information. |
| source | A name used to identify the output, typically the name of the application that generated the trace event. |
| id | A numeric identifier for the event. |
| message | A message to write. |
| relatedActivityId | A Guid object identifying a related activity. |
|
inline |
Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
| o | An Object whose fully qualified class name you want to write. |
|
inline |
Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
| o | An Object whose fully qualified class name you want to write. |
| category | A category name used to organize the output. |
|
pure virtual |
Writes the message to the listener you create when you implement the trace_listener class.
| message | A string you want to write. |
Implemented in xtd::diagnostics::default_trace_listener, xtd::diagnostics::ostream_trace_listener, and xtd::forms::control_trace_listener.
|
inline |
Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
| o | An Object whose fully qualified class name you want to write. |
|
inline |
Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
| o | An Object whose fully qualified class name you want to write. |
| category | A category name used to organize the output. |
|
pure virtual |
Writes the message to the listener you create when you implement the trace_listener class followed by a line terminator.followed by a line terminator.
| message | A string you want to write. |
Implemented in xtd::diagnostics::default_trace_listener, xtd::diagnostics::ostream_trace_listener, and xtd::forms::control_trace_listener.
|
nodiscardprotectednoexcept |
Gets a value indicating whether to indent the output.
|
protectednoexcept |
Sets a value indicating whether to indent the output.
| need_indent | true if the output should be indented; otherwise, false. |
|
protectednoexcept |
Sets a value indicating whether the trace listener is thread safe.
| thread_safe | true if the trace listener is thread safe; otherwise, false. The default is false. |
|
inlineprotectedvirtual |
Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.