Provides a set of methods and properties that help you debug the execution of your code. This class cannot be inherited.
Provides a set of methods and properties that help you debug the execution of your code....
Definition trace.hpp:38
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:37
#define core_export_
Define shared library export.
Definition core_export.hpp:13
- Inheritance
- xtd::static_object → xtd::diagnostics::trace
- Header
#include <xtd/diagnostics/trace>
- Namespace
- xtd::diagnostics
- Library
- xtd.core
- Note
- Adding a trace listener to the listeners collection can cause an exception to be thrown while tracing, if a resource used by the trace listener is not available. The conditions and the exception thrown depend on the trace listener and cannot be enumerated in this topic. It may be useful to place calls to the debug methods in try/catch blocks to detect and handle any exceptions from trace listeners.
- Note
- If you define
#define TRACE above your includes, trace mode will still be active even if NTRACE is defined. ///
- Examples
- Examples
- The following example uses debug to indicate the beginning and the end of a program's execution. The example also uses the debug::indent and debug::unindent methods to distinguish the tracing output.
#define DEBUG 1
#include <xtd/xtd>
auto main() -> int {
}
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static auto listeners() -> listener_collection &
Gets the collection of listeners that is monitoring the trace output.
static auto indent() noexcept -> void
Increases the current indent_level by one.
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:326
static auto unindent() noexcept -> void
Decreases the current indent_level by one.
static auto auto_flush() noexcept -> bool
Gets whether Flush should be called on the Listeners after every write.
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
|
| static auto | auto_flush () noexcept -> bool |
| | Gets whether Flush should be called on the Listeners after every write.
|
| |
| static auto | auto_flush (bool auto_flush) noexcept -> void |
| | Sets whether Flush should be called on the Listeners after every write.
|
| |
| static auto | indent_level () noexcept -> xtd::uint32 |
| | Gets the indent level.
|
| |
| static auto | indent_level (xtd::uint32 indent_level) noexcept -> void |
| | Sets the indent level.
|
| |
| static auto | indent_size () noexcept -> xtd::uint32 |
| | Gets the number of spaces in an indent.
|
| |
| static auto | indent_size (xtd::uint32 indent_size) noexcept -> void |
| | Sets the number of spaces in an indent.
|
| |
| static auto | listeners () -> listener_collection & |
| | Gets the collection of listeners that is monitoring the trace output.
|
| |
| static auto | listeners (const listener_collection &listeners) -> void |
| | Sets the collection of listeners that is monitoring the trace output.
|
| |
| static auto | use_global_lock () noexcept -> bool |
| | Gets a value indicating whether the global lock should be used.
|
| |
| static auto | use_global_lock (bool use_global_lock) noexcept -> void |
| | Sets a value indicating whether the global lock should be used.
|
| |
|
| static auto | cassert (bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void |
| | Checks for a condition; if the condition is false, displays a message box that shows the call stack.
|
| |
| static auto | cassert (bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void |
| | Checks for a condition; if the condition is false, displays a message box that shows the call stack.
|
| |
| static auto | cassert (bool condition, const xtd::string &message, const xtd::string &detail_message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void |
| | Checks for a condition; if the condition is false, displays a message box that shows the call stack.
|
| |
| static auto | fail (const xtd::string &message) -> void |
| | Emits the specified error message.
|
| |
| static auto | fail (const xtd::string &message, const xtd::string &detail_message) -> void |
| | 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 auto | indent () noexcept -> void |
| | Increases the current indent_level by one.
|
| |
| static auto | print (const xtd::string &message) -> void |
| | Writes a message followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| template<class ... args_t> |
| static auto | print (const xtd::string &format, args_t &&... args) -> void |
| | Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| static auto | trace_error (const xtd::string &message) -> void |
| | Writes an error message to the trace listeners in the Listeners collection using the specified message.
|
| |
| template<class ... objects> |
| static auto | trace_error (const xtd::string &message, const objects &... args) -> void |
| | Writes an error message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
|
| |
| static auto | trace_information (const xtd::string &message) -> void |
| | Writes an informational message to the trace listeners in the listeners collection using the specified message.
|
| |
| template<class ... objects> |
| static auto | trace_information (const xtd::string &message, const objects &... args) -> void |
| | Writes an informational message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
|
| |
| static auto | trace_warning (const xtd::string &message) -> void |
| | Writes a warning message to the trace listeners in the listeners collection using the specified message.
|
| |
| template<class ... objects> |
| static auto | trace_warning (const xtd::string &message, const objects &... args) -> void |
| | Writes a warning message to the trace listeners in the listeners collection using the specified array of objects and formatting information.
|
| |
| static auto | unindent () noexcept -> void |
| | Decreases the current indent_level by one.
|
| |
| static auto | write (const xtd::string &message) -> void |
| | Writes a message to the trace listeners in the listeners collection.
|
| |
| template<class object_t> |
| static auto | write (const object_t &message) -> void |
| | Writes a message to the trace listeners in the listeners collection.
|
| |
| template<class object_t> |
| static auto | write (const object_t &message, const xtd::string &category) -> void |
| | Writes a category name and message to the trace listeners in the listeners collection.
|
| |
| template<class ... args_t> |
| static auto | write (const xtd::string &format, args_t &&... args) -> void |
| | Writes a formatted string to the trace listeners in the listeners collection.
|
| |
| static auto | write_if (bool condition, const xtd::string &message) -> void |
| | Writes a message to the trace listeners in the Listeners collection if a condition is true.
|
| |
| template<class object_t> |
| static auto | write_if (bool condition, const object_t &message) -> void |
| | Writes a message to the trace listeners in the Listeners collection if a condition is true.
|
| |
| template<class object_t> |
| static auto | write_if (bool condition, const object_t &message, const xtd::string &category) -> void |
| | Writes a category name and message to the trace listeners in the Listeners collection if a condition is true.
|
| |
| static auto | write_line () -> void |
| | Writes a line terminator to the trace listeners in the listeners collection.
|
| |
| static auto | write_line (const xtd::string &message) -> void |
| | Writes a message followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| template<class object_t> |
| static auto | write_line (const object_t &message) -> void |
| | Writes a message followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| template<class object_t> |
| static auto | write_line (const object_t &message, const xtd::string &category) -> void |
| | Writes a category name and message followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| template<class ... args_t> |
| static auto | write_line (const xtd::string &format, args_t &&... args) -> void |
| | Writes a formatted string followed by a line terminator to the trace listeners in the listeners collection.
|
| |
| static auto | write_line_if (bool condition, const xtd::string &message) -> void |
| | Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
|
| |
| template<class object_t> |
| static auto | write_line_if (bool condition, const object_t &message) -> void |
| | Writes a message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
|
| |
| template<class object_t> |
| static auto | write_line_if (bool condition, const object_t &message, const xtd::string &category) -> void |
| | Writes a category name and message followed by a line terminator to the trace listeners in the Listeners collection if a condition is true.
|
| |