xtd - Reference Guide
0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <debug.h>
Provides a set of methods and properties that help you debug the execution of your code. This class cannot be inherited.
Inherits xtd::static_object.
Public Types | |
using | listener_collection = xtd::diagnostics::trace_listener_collection |
Represents a collection of xtd::diagnostics::trace_listener. More... | |
Static Public Member Functions | |
static bool | auto_flush () |
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write. More... | |
static void | auto_flush (bool auto_flush) |
Sets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write. More... | |
static void | cassert (bool condition) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. More... | |
static void | cassert (bool condition, const xtd::diagnostics::stack_frame &stack_frame) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. More... | |
static void | cassert (bool condition, const xtd::ustring &message) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. More... | |
static void | cassert (bool condition, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame) |
Checks for a condition; if the condition is false, displays a message box that shows the call stack. More... | |
static void | fail (const xtd::ustring &message) |
Emits the specified error message. More... | |
static void | fail (const xtd::ustring &message, const xtd::ustring &detail_message) |
Emits an error message and a detailed error message. More... | |
static void | flush () |
Flushes the output buffer and causes buffered data to write to the listeners collection. More... | |
static void | indent () |
Increases the current indent_level by one. More... | |
static uint32_t | indent_level () |
Gets the indent level. More... | |
static void | indent_level (uint32_t indent_level) |
Sets the indent level. More... | |
static uint32_t | indent_size () |
Gets the number of spaces in an indent. More... | |
static void | indent_size (uint32_t indent_size) |
Sets the number of spaces in an indent. More... | |
static listener_collection & | listeners () |
Gets the collection of listeners that is monitoring the trace output. More... | |
static void | listeners (const listener_collection &listeners) |
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. More... | |
template<typename ... args_t> | |
static void | print (const xtd::ustring &format, args_t &&... args) |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection. More... | |
static void | print (const xtd::ustring &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. More... | |
static bool | show_assert_dialog () |
Gets a value indicating whether the assert dialog should be show. More... | |
static void | show_assert_dialog (bool show_assert_dialog) |
Sets a value indicating whether the assert dialog should be show. More... | |
static void | trace_error (const xtd::ustring &message) |
Writes an error message to the trace listeners in the Listeners collection using the specified message. More... | |
template<typename ... objects_t> | |
static void | trace_error (const xtd::ustring &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. More... | |
static 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> | |
static void | trace_information (const xtd::ustring &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. More... | |
static void | trace_warning (const xtd::ustring &message) |
Writes a warning message to the trace listeners in the listeners collection using the specified message. More... | |
template<typename ... objects_t> | |
static void | trace_warning (const xtd::ustring &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. More... | |
static void | unindent () |
Decreases the current indent_level by one. More... | |
static bool | use_global_lock () |
Gets a value indicating whether the global lock should be used. More... | |
static void | use_global_lock (bool use_global_lock) |
Sets a value indicating whether the global lock should be used. More... | |
template<typename object_t > | |
static void | write (const object_t &message) |
Writes a message to the trace listeners in the listeners collection. More... | |
template<typename object_t > | |
static void | write (const object_t &message, const xtd::ustring &category) |
Writes a category name and message to the trace listeners in the listeners collection. More... | |
template<typename ... args_t> | |
static void | write (const xtd::ustring &format, args_t &&... args) |
Writes a formatted string to the trace listeners in the listeners collection. More... | |
static void | write (const xtd::ustring &message) |
Writes a message to the trace listeners in the listeners collection. More... | |
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. More... | |
template<typename object_t > | |
static void | write_if (bool condition, const object_t &message, const xtd::ustring &category) |
Writes a category name and message to the trace listeners in the Listeners collection if a condition is true. More... | |
static void | write_if (bool condition, const xtd::ustring &message) |
Writes a message to the trace listeners in the Listeners collection if a condition is true. More... | |
static void | write_line () |
Writes a line terminator to the trace listeners in the listeners collection. More... | |
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. More... | |
template<typename object_t > | |
static void | write_line (const object_t &message, const xtd::ustring &category) |
Writes a category name and message followed by a line terminator to the trace listeners in the listeners collection. More... | |
template<typename ... args_t> | |
static void | write_line (const xtd::ustring &format, args_t &&... args) |
Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection. More... | |
static void | write_line (const xtd::ustring &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. More... | |
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. More... | |
template<typename object_t > | |
static void | write_line_if (bool condition, const object_t &message, const xtd::ustring &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. More... | |
static void | write_line_if (bool condition, const xtd::ustring &message) |
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true. More... | |
Represents a collection of xtd::diagnostics::trace_listener.
|
static |
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listeners after every write.
|
static |
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. |
|
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. |
|
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 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. |
|
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 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.
|
static |
Increases the current indent_level by one.
|
static |
Gets the indent level.
|
static |
Sets the indent level.
indent_level | The indent level. The default is zero. |
|
static |
Gets the number of spaces in an indent.
|
static |
Sets the number of spaces in an indent.
indent_size | The number of spaces in an indent. The default is four. |
|
static |
Gets the collection of listeners that is monitoring the trace output.
|
static |
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.
|
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.
message | The message to write. |
|
static |
Gets a value indicating whether the assert dialog should be show.
|
static |
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. |
|
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. |
|
static |
Decreases the current indent_level by one.
|
static |
Gets a value indicating whether the global lock should be used.
|
static |
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. |
|
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.
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 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 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.
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. |
|
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. |