Provides a set of methods and properties that help you debug the execution of your code. This class cannot be inherited.
Public Aliases | |
using | listener_collection = xtd::diagnostics::trace_listener_collection |
Represents a collection of xtd::diagnostics::trace_listener. | |
Public Static Properties | |
static bool | auto_flush () noexcept |
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write. | |
static void | auto_flush (bool auto_flush) noexcept |
Sets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write. | |
static uint32 | indent_level () noexcept |
Gets the indent level. | |
static void | indent_level (uint32 indent_level) noexcept |
Sets the indent level. | |
static uint32 | indent_size () noexcept |
Gets the number of spaces in an indent. | |
static void | indent_size (uint32 indent_size) noexcept |
Sets the number of spaces in an indent. | |
static listener_collection & | listeners () noexcept |
Gets the collection of listeners that is monitoring the trace output. | |
static void | listeners (const listener_collection &listeners) noexcept |
Sets the collection of listeners that is monitoring the trace output. @paral$m listeners A xtd::diagnostics::debug::listener_collection that represents a collection of type xtd::diagnostics::trace_listener monitoring the trace output. | |
static bool | show_assert_dialog () noexcept |
Gets a value indicating whether the assert dialog should be show. | |
static void | show_assert_dialog (bool show_assert_dialog) noexcept |
Sets a value indicating whether the assert dialog should be show. | |
static bool | use_global_lock () noexcept |
Gets a value indicating whether the global lock should be used. | |
static void | use_global_lock (bool use_global_lock) noexcept |
Sets a value indicating whether the global lock should be used. | |
Public Static Methods | |
static void | cassert (bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. | |
static void | cassert (bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. | |
static void | cassert (bool condition, const xtd::string &message, const xtd::string &detail_message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. | |
static void | fail (const xtd::string &message) |
Emits the specified error message. | |
static void | fail (const xtd::string &message, const xtd::string &detail_message) |
Emits an error message and a detailed error message. | |
static void | flush () |
Flushes the output buffer and causes buffered data to write to the listeners collection. | |
static void | indent () noexcept |
Increases the current indent_level by one. | |
static void | print (const xtd::string &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename ... args_t> | |
static void | print (const xtd::string &format, args_t &&... args) |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection. | |
static void | trace_error (const xtd::string &message) |
Writes an error message to the trace listeners in the Listeners collection using the specified message. | |
template<typename ... objects_t> | |
static void | trace_error (const xtd::string &message, const objects_t &... args) |
Writes an error message to the trace listeners in the listeners collection using the specified array of objects and formatting information. | |
static void | trace_information (const xtd::string &message) |
Writes an informational message to the trace listeners in the listeners collection using the specified message. | |
template<typename ... objects_t> | |
static void | trace_information (const xtd::string &message, const objects_t &... args) |
Writes an informational message to the trace listeners in the listeners collection using the specified array of objects and formatting information. | |
static void | trace_warning (const xtd::string &message) |
Writes a warning message to the trace listeners in the listeners collection using the specified message. | |
template<typename ... objects_t> | |
static void | trace_warning (const xtd::string &message, const objects_t &... args) |
Writes a warning message to the trace listeners in the listeners collection using the specified array of objects and formatting information. | |
static void | unindent () noexcept |
Decreases the current indent_level by one. | |
static void | write (const xtd::string &message) |
Writes a message to the trace listeners in the listeners collection. | |
template<typename object_t > | |
static void | write (const object_t &message) |
Writes a message to the trace listeners in the listeners collection. | |
template<typename object_t > | |
static void | write (const object_t &message, const xtd::string &category) |
Writes a category name and message to the trace listeners in the listeners collection. | |
template<typename ... args_t> | |
static void | write (const xtd::string &format, args_t &&... args) |
Writes a formatted string to the trace listeners in the listeners collection. | |
static void | write_if (bool condition, const xtd::string &message) |
Writes a message to the trace listeners in the Listeners collection if a condition is true. | |
template<typename object_t > | |
static void | write_if (bool condition, const object_t &message) |
Writes a message to the trace listeners in the Listeners collection if a condition is true. | |
template<typename object_t > | |
static void | write_if (bool condition, const object_t &message, const xtd::string &category) |
Writes a category name and message to the trace listeners in the Listeners collection if a condition is true. | |
static void | write_line () |
Writes a line terminator to the trace listeners in the listeners collection. | |
static void | write_line (const xtd::string &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename object_t > | |
static void | write_line (const object_t &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename object_t > | |
static void | write_line (const object_t &message, const xtd::string &category) |
Writes a category name and message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename ... args_t> | |
static void | write_line (const xtd::string &format, args_t &&... args) |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection. | |
static void | write_line_if (bool condition, const xtd::string &message) |
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true. | |
template<typename object_t > | |
static void | write_line_if (bool condition, const object_t &message) |
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true. | |
template<typename object_t > | |
static void | write_line_if (bool condition, const object_t &message, const xtd::string &category) |
Writes a category name and message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true. | |
Represents a collection of xtd::diagnostics::trace_listener.
|
staticnoexcept |
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write.
|
staticnoexcept |
Sets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write.
auto_flush | true if xtd::diagnostics::debug::flush is called on the xtd::diagnostics::debug::listeners after every write; otherwise, false. |
|
staticnoexcept |
Gets the indent level.
|
staticnoexcept |
Sets the indent level.
indent_level | The indent level. The default is zero. |
|
staticnoexcept |
Gets the number of spaces in an indent.
|
staticnoexcept |
Sets the number of spaces in an indent.
indent_size | The number of spaces in an indent. The default is four. |
|
staticnoexcept |
Gets the collection of listeners that is monitoring the trace output.
|
staticnoexcept |
Sets the collection of listeners that is monitoring the trace output. @paral$m listeners A xtd::diagnostics::debug::listener_collection that represents a collection of type xtd::diagnostics::trace_listener monitoring the trace output.
|
staticnoexcept |
Gets a value indicating whether the assert dialog should be show.
|
staticnoexcept |
Sets a value indicating whether the assert dialog should be show.
show_assert_dialog | true if assert dialog is to be shown; otherwise, false. The default is true. |
|
staticnoexcept |
Gets a value indicating whether the global lock should be used.
|
staticnoexcept |
Sets a value indicating whether the global lock should be used.
use_global_lock | true if the global lock is to be used; otherwise, false. The default is true. |
|
static |
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
condition | The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed. |
stack_frame | The (optional) stack frame corresponding to the generated assert. |
|
static |
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
condition | The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed. |
message | The message to send to the xtd::diagnostics::debug::listeners collection. |
stack_frame | The (optional) stack frame corresponding to the generated assert. |
|
static |
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
condition | The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed. |
message | The message to send to the xtd::diagnostics::debug::listeners collection. |
detail_message | The detailed message to send to the xtd::diagnostics::debug::listeners collection. |
stack_frame | The (optional) stack frame corresponding to the generated assert. |
|
inlinestatic |
Emits the specified error message.
message | A message to emit. |
|
inlinestatic |
Emits an error message and a detailed error message.
message | A message to emit. |
detail_message | A detailed message to emit. |
|
inlinestatic |
Flushes the output buffer and causes buffered data to write to the listeners collection.
|
staticnoexcept |
Increases the current indent_level by one.
|
inlinestatic |
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
message | The message to write. |
|
inlinestatic |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection.
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. |
xtd::format_exception | 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. |
|
inlinestatic |
Writes an error message to the trace listeners in the Listeners collection using the specified message.
message | The informative message to write. |
|
inlinestatic |
Writes an error message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
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. |
|
inlinestatic |
Writes an informational message to the trace listeners in the listeners collection using the specified message.
message | The informative message to write. |
|
inlinestatic |
Writes an informational message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
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. |
|
inlinestatic |
Writes a warning message to the trace listeners in the listeners collection using the specified message.
message | The informative message to write. |
|
inlinestatic |
Writes a warning message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
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. |
|
staticnoexcept |
Decreases the current indent_level by one.
|
inlinestatic |
Writes a message to the trace listeners in the listeners collection.
message | A message to write. |
|
inlinestatic |
Writes a message to the trace listeners in the listeners collection.
message | A message to write. |
|
inlinestatic |
Writes a category name and message to the trace listeners in the listeners collection.
message | A message to write. |
category | A category name used to organize the output. |
|
inlinestatic |
Writes a formatted string to the trace listeners in the listeners collection.
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. |
|
inlinestatic |
Writes a message to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
|
inlinestatic |
Writes a message to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
|
inlinestatic |
Writes a category name and message to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
category | A category name used to organize the output. |
|
inlinestatic |
Writes a line terminator to the trace listeners in the listeners collection.
message | A message to write. |
|
inlinestatic |
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
message | A message to write. |
|
inlinestatic |
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
message | A message to write. |
|
inlinestatic |
Writes a category name and message followed by a line terminator to the trace listeners in the listeners collection.
message | A message to write. |
category | A category name used to organize the output. |
|
inlinestatic |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection.
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. |
xtd::format_exception | 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. |
|
inlinestatic |
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
|
inlinestatic |
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
|
inlinestatic |
Writes a category name and message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
condition | true to cause a message to be written; otherwise, false. |
message | A message to write. |
category | A category name used to organize the output. |