7 #include "../add_last_arg_to_command.h" 8 #include "../core_export.h" 9 #include "../environment.h" 10 #include "../static.h" 11 #include "../ustring.h" 26 namespace diagnostics {
73 static bool auto_flush() noexcept;
78 static
void auto_flush(
bool auto_flush) noexcept;
83 static
uint32 indent_level() noexcept;
87 static
void indent_level(
uint32 indent_level) noexcept;
92 static
uint32 indent_size() noexcept;
96 static
void indent_size(
uint32 indent_size) noexcept;
113 static
bool show_assert_dialog() noexcept;
118 static
void show_assert_dialog(
bool show_assert_dialog) noexcept;
123 static
bool use_global_lock() noexcept;
127 static
void use_global_lock(
bool use_global_lock) noexcept;
138 static
void cassert(
bool condition);
142 static
void cassert(
bool condition, const
xtd::
ustring& message);
152 static
void cassert(
bool condition, const
xtd::
ustring& message, const
xtd::
ustring& detail_message);
158 static
void cassert(
bool condition, const
xtd::
ustring& message, const
xtd::
ustring& detail_message, const
xtd::diagnostics::stack_frame& stack_frame);
162 static
void cassert(
bool condition, const
xtd::diagnostics::stack_frame& stack_frame);
169 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 179 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 180 fail__(message, detail_message);
186 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 192 static void indent() noexcept;
198 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 199 write_line_(message);
206 template<
typename ...args_t>
208 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 213 template<
typename ...args_t>
214 static void print(
const char* format, args_t&& ... args) {
215 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 225 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 233 template<
typename ...objects_t>
235 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 244 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 252 template<
typename ...objects_t>
254 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 263 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 271 template<
typename ...objects_t>
273 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 279 static void unindent() noexcept;
286 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 294 template<
typename object_t>
295 static void write(
const object_t& message) {
296 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 306 template<
typename object_t>
308 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 317 template<
typename ...args_t>
319 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 324 template<
typename ...args_t>
325 static void write(
const char* format, args_t&& ... args) {
326 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 338 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 339 if (condition) write_(message);
342 template<
typename object_t>
348 static void write_if(
bool condition,
const object_t& message) {
349 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 359 template<
typename object_t>
361 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 371 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 380 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 381 write_line_(message);
388 template<
typename object_t>
390 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 400 template<
typename object_t>
402 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 410 template<
typename ...args_t>
412 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 417 template<
typename ...args_t>
418 static void write_line(
const char* format, args_t&& ... args) {
419 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 431 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 432 if (condition) write_line_(message);
440 template<
typename object_t>
442 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 443 if (condition) write_line_(message);
452 template<
typename object_t>
454 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 455 if (condition) write_line_(message, category);
460 static inline bool __should_aborted__(
bool condition) {
return __should_aborted__(condition,
"",
csf_);}
461 static inline bool __should_aborted__(
bool condition,
const xtd::ustring& message) {
return __should_aborted__(condition, message,
csf_);}
464 static inline bool __should_aborted__(
bool condition,
const xtd::ustring& message,
const xtd::ustring& detail_message) {
return __should_aborted__(condition, message, detail_message,
csf_);}
466 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 467 auto result = xtd::diagnostics::debug::assert_dialog(condition, message, detail_message, stack_frame);
483 static void flush_();
490 inline static bool auto_flush_ =
false;
491 inline static uint32 indent_level_ = 0;
492 inline static uint32 indent_size_ = 4;
494 static bool& show_assert_dialog_;
520 #define cassert_(...) \ 521 add_last_arg_to_command_(cassert, (csf_), __VA_ARGS__) Contains xtd::diagnostics::stack_trace class.
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: debug.h:262
Contains xtd::diagnostics::debugger class.
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: debug.h:337
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: debug.h:207
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: debug.h:224
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:37
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 ...
Definition: debug.h:234
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static void write(const xtd::ustring &format, args_t &&... args)
Writes a formatted string to the trace listeners in the listeners collection.
Definition: debug.h:318
#define csf_
Provides information about the current stack frame.
Definition: current_stack_frame.h:30
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 ...
Definition: debug.h:360
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
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 ...
Definition: debug.h:441
static void exit()
Terminates this process and returns an exit code to the operating system.
The assert dialog return value is Abort (usually sent from a button labeled Abort).
assert_dialog_result
Specifies identifiers to indicate the return value of an assert dialog box.
Definition: assert_dialog_result.h:23
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.
Definition: debug.h:307
static void flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition: debug.h:185
Represents a collection of xtd::diagnostics::trace_listener.
Definition: trace_listener_collection.h:26
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:37
Contains xtd::diagnostics::trace_listener_collection class.
The assert dialog return value is Retry (usually sent from a button labeled Retry).
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...
Definition: debug.h:348
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: debug.h:379
static void fail(const xtd::ustring &message, const xtd::ustring &detail_message)
Emits an error message and a detailed error message.
Definition: debug.h:178
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 Listen...
Definition: debug.h:453
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: debug.h:411
static void write_line(const object_t &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection...
Definition: debug.h:389
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 listen...
Definition: debug.h:401
Provides a set of methods and properties that help you debug the execution of your code...
Definition: trace.h:38
Provides a set of methods and properties that help you debug the execution of your code...
Definition: debug.h:57
static void write(const xtd::ustring &message)
Writes a message to the trace listeners in the listeners collection.
Definition: debug.h:285
static void print(const xtd::ustring &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection...
Definition: debug.h:197
static void trace_information(const xtd::ustring &message)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition: debug.h:243
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...
Definition: debug.h:272
static void write(const object_t &message)
Writes a message to the trace listeners in the listeners collection.
Definition: debug.h:295
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239
Contains xtd::diagnostics::assert_dialog_result enum class.
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition: debug.h:370
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: debug.h:430
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 specifie...
Definition: debug.h:253
trace_event_type
Identifies the type of event that has caused the trace.
Definition: trace_event_type.h:23