xtd - Reference Guide
0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <trace.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. | |
Static Public Member Functions | |
static bool | auto_flush () |
Get whether Flush should be called on the Listeners after every write. | |
static void | auto_flush (bool auto_flush) |
Sets whether Flush should be called on the Listeners after every write. | |
static void | cassert (bool condition) |
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::diagnostics::stack_frame &stack_frame) |
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::ustring &message) |
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::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. | |
static void | fail (const xtd::ustring &message) |
Emits the specified error message. | |
static void | fail (const xtd::ustring &message, const xtd::ustring &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 () |
Increases the current indent_level by one. | |
static uint32_t | indent_level () |
Gets the indent level. | |
static void | indent_level (uint32_t indent_level) |
Sets the indent level. | |
static uint32_t | indent_size () |
Gets the number of spaces in an indent. | |
static void | indent_size (uint32_t indent_size) |
Sets the number of spaces in an indent. | |
static listener_collection & | listeners () |
Gets the collection of listeners that is monitoring the trace output. | |
static void | listeners (const listener_collection &listeners) |
Sets the collection of listeners that is monitoring the trace output. | |
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. | |
static void | print (const xtd::ustring &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
static bool | show_assert_dialog () |
Gets a value indicating whether the assert dialog should be show. | |
static void | show_assert_dialog (bool show_assert_dialog) |
Sets a value indicating whether the assert dialog should be show. | |
static void | trace_error (const xtd::ustring &message) |
Writes an error message to the trace listeners in the Listeners collection using the specified message. | |
template<typename ... objects> | |
static void | trace_error (const xtd::ustring &message, const objects &... 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::ustring &message) |
Writes an informational message to the trace listeners in the listeners collection using the specified message. | |
template<typename ... objects> | |
static void | trace_information (const xtd::ustring &message, const objects &... 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::ustring &message) |
Writes a warning message to the trace listeners in the listeners collection using the specified message. | |
template<typename ... objects> | |
static void | trace_warning (const xtd::ustring &message, const objects &... 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 () |
Decreases the current indent_level by one. | |
static bool | use_global_lock () |
Gets a value indicating whether the global lock should be used. | |
static void | use_global_lock (bool use_global_lock) |
Sets a value indicating whether the global lock should be used. | |
template<typename object > | |
static void | write (const object &message) |
Writes a message to the trace listeners in the listeners collection. | |
template<typename object > | |
static void | write (const object &message, const xtd::ustring &category) |
Writes a category name and message to the trace listeners in the listeners collection. | |
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. | |
static void | write (const xtd::ustring &message) |
Writes a message to the trace listeners in the listeners collection. | |
template<typename object > | |
static void | write_if (bool condition, const object &message) |
Writes a message to the trace listeners in the Listeners collection if a condition is true. | |
template<typename object > | |
static void | write_if (bool condition, const object &message, const xtd::ustring &category) |
Writes a category name and message to the trace listeners in the Listeners collection if a condition is true. | |
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. | |
static void | write_line () |
Writes a line terminator to the trace listeners in the listeners collection. | |
template<typename object > | |
static void | write_line (const object &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename object > | |
static void | write_line (const object &message, const xtd::ustring &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::ustring &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 (const xtd::ustring &message) |
Writes a message followed by a line terminator to the trace listeners in the listeners collection. | |
template<typename object > | |
static void | write_line_if (bool condition, const object &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 > | |
static void | write_line_if (bool condition, const object &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. | |
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. | |
Represents a collection of xtd::diagnostics::trace_listener.
|
static |
Get whether Flush should be called on the Listeners after every write.
|
static |
Sets whether Flush should be called on the Listeners after every write.
auto_flush | true if Flush is called on the 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 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.
listeners | A listener_collection that represents a collection of type 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.
|
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. |