10 namespace diagnostics {
132 fail__(message, detail_message);
150 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
151 write_line_(message);
158 template<
typename ...args_t>
160 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
165 template<
typename ...args_t>
166 static void print(
const char* format, args_t&&... args) {
167 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
177 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
185 template<
typename ...objects>
187 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
196 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
204 template<
typename ...objects>
206 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
215 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
223 template<
typename ...objects>
225 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
247 template<
typename object>
248 static void write(
const object& message) {
259 template<
typename object>
270 template<
typename ...args_t>
277 template<
typename ...args_t>
278 static void write(
const char* format, args_t&&... args) {
292 if (condition) write_(message);
300 template<
typename object>
301 static void write_if(
bool condition,
const object& message) {
312 template<
typename object>
334 write_line_(message);
341 template<
typename object>
353 template<
typename object>
363 template<
typename ...args_t>
370 template<
typename ...args_t>
371 static void write_line(
const char* format, args_t&&... args) {
385 if (condition) write_line_(message);
393 template<
typename object>
405 template<
typename object>
413 static inline bool __should_aborted__(
bool condition) {
return __should_aborted__(condition,
"",
csf_); }
414 static inline bool __should_aborted__(
bool condition,
const xtd::ustring& message) {
return __should_aborted__(condition, message,
csf_); }
415 static inline bool __should_aborted__(
bool condition,
const xtd::diagnostics::stack_frame& stack_frame) {
return __should_aborted__(condition,
"", stack_frame); }
418 auto result = xtd::diagnostics::debug::assert_dialog(condition, message, stack_frame);
429 static void flush_();
436 inline static bool auto_flush_ =
false;
437 inline static unsigned int indent_level_ = 0;
438 inline static unsigned int indent_size_ = 4;
439 static listener_collection& listeners_;
440 static bool& show_assert_dialog_;
441 inline static bool use_global_lock_ =
true;
442 static std::mutex global_lock_;
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
Represents a collection of xtd::diagnostics::trace_listener.
Definition: trace_listener_collection.h:19
Provides a set of methods and properties that help you debug the execution of your code....
Definition: trace.h:31
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 write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition: trace.h:323
static void write(const object &message, const xtd::ustring &category)
Writes a category name and message to the trace listeners in the listeners collection.
Definition: trace.h:260
static void write(const xtd::ustring &format, args_t &&... args)
Writes a formatted string to the trace listeners in the listeners collection.
Definition: trace.h:271
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 specifie...
Definition: trace.h:205
static void fail(const xtd::ustring &message, const xtd::ustring &detail_message)
Emits an error message and a detailed error message.
Definition: trace.h:130
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.
static void print(const xtd::ustring &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition: trace.h:149
static void write_line(const object &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition: trace.h:342
static void indent()
Increases the current indent_level by one.
static void fail(const xtd::ustring &message)
Emits the specified error message.
Definition: trace.h:120
static void write(const xtd::ustring &message)
Writes a message to the trace listeners in the listeners collection.
Definition: trace.h:237
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 ...
Definition: trace.h:186
static bool use_global_lock()
Gets a value indicating whether the global lock should be used.
static void write_line(const xtd::ustring &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition: trace.h:332
static void trace_warning(const xtd::ustring &message)
Writes a warning message to the trace listeners in the listeners collection using the specified messa...
Definition: trace.h:214
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 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 messag...
Definition: trace.h:176
static void indent_size(uint32_t indent_size)
Sets the number of spaces in an indent.
static void indent_level(uint32_t indent_level)
Sets the indent level.
static void write(const object &message)
Writes a message to the trace listeners in the listeners collection.
Definition: trace.h:248
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 colle...
Definition: trace.h:159
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 ...
Definition: trace.h:313
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 listen...
Definition: trace.h:354
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...
Definition: trace.h:224
static uint32_t indent_level()
Gets the indent level.
static bool show_assert_dialog()
Gets a value indicating whether the assert dialog should be show.
static void use_global_lock(bool use_global_lock)
Sets a value indicating whether the global lock should be used.
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 flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition: trace.h:137
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 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 Listen...
Definition: trace.h:406
static void auto_flush(bool auto_flush)
Sets whether Flush should be called on the Listeners after every write.
static bool auto_flush()
Get whether Flush should be called on the Listeners after every write.
static uint32_t indent_size()
Gets the number of spaces in an indent.
static void trace_information(const xtd::ustring &message)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition: trace.h:195
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.
Definition: trace.h:301
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 ...
Definition: trace.h:394
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 ...
Definition: trace.h:383
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.
Definition: trace.h:290
static void unindent()
Decreases the current indent_level by one.
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 colle...
Definition: trace.h:364
static void exit(int exit_code)
Terminates this process and returns an exit code to the operating system.
Definition: environment.h:321
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::diagnostics::debug class.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:38
#define core_export_
Define shared library export.
Definition: core_export.h:13
#define csf_
Provides information about the current stack frame.
Definition: stack_frame.h:213
trace_event_type
Identifies the type of event that has caused the trace.
Definition: trace_event_type.h:18
@ retry
The assert dialog return value is Retry (usually sent from a button labeled Retry).
@ abort
The assert dialog return value is Abort (usually sent from a button labeled Abort).
@ warning
Warning Noncritical problem.
@ information
Informational message.
@ error
Recoverable error.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17