Provides the default output methods and behavior for tracing.
Public Constructors | |
default_trace_listener () | |
Initializes a new instance of the default_trace_listener class with "default" as its xtd::diagnostics::default_trace_listener::name property value. | |
Public Properties | |
bool | assert_ui_enabled () const noexcept |
Gets a value indicating whether the application is running in user-interface mode. | |
void | assert_ui_enabled (bool assert_ui_enabled) noexcept |
Sets a value indicating whether the application is running in user-interface mode. | |
xtd::ustring | log_file_name () const noexcept |
Gets the name of a log file to write trace or debug messages to. | |
void | log_file_name (const xtd::ustring log_file_name) noexcept |
Sets the name of a log file to write trace or debug messages to. | |
Public Methods | |
void | close () override |
When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output. | |
void | flush () override |
When overridden in a derived class, flushes the output buffer. | |
void | write (const xtd::ustring &message) override |
Writes the message to the listener you create when you implement the trace_listener class. | |
void | write_line (const xtd::ustring &message) override |
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. | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::diagnostics::trace_listener | |
trace_listener ()=default | |
Initializes a new instance of the trace_listener class. | |
trace_listener (const xtd::ustring &name) | |
Initializes a new instance of the trace_listener class using the specified name as the listener. | |
uint32 | indent_level () const noexcept |
Gets the indent level. | |
void | indent_level (uint32 indent_level) noexcept |
Sets the indent level. | |
uint32 | indent_size () const noexcept |
Gets the number of spaces in an indent. | |
void | indent_size (uint32 indent_size) noexcept |
Sets the number of spaces in an indent. | |
virtual bool | is_thread_safe () const noexcept |
Gets a value indicating whether the trace listener is thread safe. | |
const xtd::ustring & | name () const noexcept |
Gets or sets a name for this TraceListener. | |
void | name (const xtd::ustring &name) noexcept |
Sets a name for this TraceListener. | |
trace_options | trace_output_options () const noexcept |
Gets the trace output options. | |
void | trace_output_options (trace_options trace_output_options) noexcept |
Sets the trace output options. | |
virtual void | fail (const xtd::ustring &message) |
Emits an error message to the listener you create when you implement the TraceListener class. | |
virtual void | fail (const xtd::ustring &message, const xtd::ustring &detail_message) |
Emits the specified error message. | |
template<typename object > | |
void | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const object &data) |
Writes trace information, a data object and event information to the listener specific output. | |
template<typename object > | |
void | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const std::vector< object > &data) |
Writes trace information, a data object and event information to the listener specific output. | |
template<typename ... objects> | |
void | trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const objects &... data) |
Writes trace information, an array of data objects and event information to the listener specific output. | |
virtual void | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id) |
Writes trace and event information to the listener specific output. | |
virtual void | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &message) |
Writes trace information, a message, and event information to the listener specific output. | |
template<typename ... objects> | |
void | trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &format, const objects &... args) |
Writes trace information, a formatted array of objects and event information to the listener specific output. | |
template<typename activity_id_type > | |
void | trace_transfer (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, int32 id, const xtd::ustring &message, const activity_id_type &related_activity_id) |
Writes trace information, a message, a related activity identity and event information to the listener specific output. | |
template<typename object > | |
void | write (const object &o) |
Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
template<typename object > | |
void | write (const object &o, const xtd::ustring &category) |
Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
template<typename object > | |
void | write_line (const object &o) |
Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
template<typename object > | |
void | write_line (const object &o, const xtd::ustring &category) |
Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | 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 > | |
std::unique_ptr< object_t > | memberwise_clone () const noexcept |
Creates a shallow copy of the current object. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a sxd::ustring that represents the current object. | |
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. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
Protected Member Functions inherited from xtd::diagnostics::trace_listener | |
bool | need_indent () const noexcept |
Gets a value indicating whether to indent the output. | |
void | need_indent (bool need_indent) noexcept |
Sets a value indicating whether to indent the output. | |
void | thread_safe (bool thread_safe) noexcept |
Sets a value indicating whether the trace listener is thread safe. | |
virtual void | write_indent () |
Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false. | |
Protected Member Functions inherited from xtd::abstract_object | |
abstract_object ()=default | |
Initializes a new instance of the xtd::abstract_object class. | |
xtd::diagnostics::default_trace_listener::default_trace_listener | ( | ) |
Initializes a new instance of the default_trace_listener class with "default" as its xtd::diagnostics::default_trace_listener::name property value.
|
noexcept |
Gets a value indicating whether the application is running in user-interface mode.
|
noexcept |
Sets a value indicating whether the application is running in user-interface mode.
assert_ui_enabled | true if user-interface mode is enabled; otherwise, false. |
|
overridevirtual |
When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
Reimplemented from xtd::diagnostics::trace_listener.
|
overridevirtual |
When overridden in a derived class, flushes the output buffer.
Reimplemented from xtd::diagnostics::trace_listener.
|
noexcept |
Gets the name of a log file to write trace or debug messages to.
|
noexcept |
Sets the name of a log file to write trace or debug messages to.
log_file_name | The name of a log file to write trace or debug messages to. |
|
overridevirtual |
Writes the message to the listener you create when you implement the trace_listener class.
message | A string you want to write. |
Implements xtd::diagnostics::trace_listener.
|
overridevirtual |
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. |
Implements xtd::diagnostics::trace_listener.