116 [[deprecated(
"Replaced by xtd::diagnostics::default_trace_listener::assert_ui_enabled - Will be removed in version 0.4.0.")]]
123 [[deprecated(
"Replaced by xtd::diagnostics::default_trace_listener::assert_ui_enabled - Will be removed in version 0.4.0.")]]
159 static
void fail(const
xtd::
string& message) {
160 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
170 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
171 fail__(message, detail_message);
177 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
189 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
190 write_line_(message);
197 template<
class ...args_t>
199 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
200 write_line_(xtd::string::format(
format, args...));
204 template<
class ...args_t>
205 static void print(
const char*
format, args_t&& ... args) {
206 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
207 write_line_(xtd::string::format(
format, args...));
216 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
224 template<
class ...objects_t>
226 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
235 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
243 template<
class ...objects_t>
245 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
254 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
262 template<
class ...objects_t>
264 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
277 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
285 template<
class object_t>
286 static void write(
const object_t& message) {
287 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
288 write_(xtd::string::format(
"{}", message));
286 static void write(
const object_t& message) {
…}
297 template<
class object_t>
299 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
300 write_(xtd::string::format(
"{}", message), category);
308 template<
class ...args_t>
310 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
311 write_(string::format(
format, args...));
315 template<
class ...args_t>
316 static void write(
const char*
format, args_t&& ... args) {
317 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
318 write_(string::format(
format, args...));
329 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
330 if (condition) write_(message);
333 template<
class object_t>
339 static void write_if(
bool condition,
const object_t& message) {
340 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
341 if (condition) write_(xtd::string::format(
"{}", message));
339 static void write_if(
bool condition,
const object_t& message) {
…}
350 template<
class object_t>
352 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
353 if (condition) write_(xtd::string::format(
"{}", message), category);
362 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
371 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
372 write_line_(message);
379 template<
class object_t>
381 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
382 write_line_(xtd::string::format(
"{}", message));
391 template<
class object_t>
393 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
394 write_line_(xtd::string::format(
"{}", message), category);
401 template<
class ...args_t>
403 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
404 write_line_(string::format(
format, args...));
408 template<
class ...args_t>
409 static void write_line(
const char*
format, args_t&& ... args) {
410 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
411 write_line_(string::format(
format, args...));
422 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
423 if (condition) write_line_(message);
431 template<
class object_t>
433 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
434 if (condition) write_line_(message);
443 template<
class object_t>
445 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
446 if (condition) write_line_(message, category);
454 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
455 auto result = xtd::diagnostics::debug::assert_dialog(condition, message, detail_message, stack_frame);
466 friend xtd::forms::assert_dialog;
469 static bool internal_show_assert_dialog() noexcept;
470 static
void fail__(const xtd::
string& message);
471 static
void fail__(const xtd::
string& message, const xtd::
string& detail_message);
472 static
void flush_();
473 static
void trace_event_(trace_event_type trace_event_type, const xtd::
string& message);
474 static
void write_(const xtd::
string& message);
475 static
void write_(const xtd::
string& message, const xtd::
string& category);
476 static
void write_line_(const xtd::
string& message);
477 static
void write_line_(const xtd::
string& message, const xtd::
string& category);
479 inline static
bool auto_flush_ = false;
480 inline static uint32 indent_level_ = 0;
481 inline static uint32 indent_size_ = 4;
482 static listener_collection& listeners_;
483 static xtd::
string source_name_;
Contains add_last_arg_to_command_ macro.
Contains xtd::diagnostics::assert_dialog_result enum class.
Provides a set of methods and properties that help you debug the execution of your code....
Definition debug.hpp:59
static void write(const xtd::string &message)
Writes a message to the trace listeners in the listeners collection.
Definition debug.hpp:276
static void write_if(bool condition, const object_t &message, const xtd::string &category)
Writes a category name and message to the trace listeners in the Listeners collection if a condition ...
Definition debug.hpp:351
static void trace_information(const xtd::string &message, const objects_t &... args)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition debug.hpp:244
static void cassert(bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
static void indent() noexcept
Increases the current indent_level by one.
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition debug.hpp:361
static void fail(const xtd::string &message)
Emits the specified error message.
Definition debug.hpp:159
static void write(const object_t &message, const xtd::string &category)
Writes a category name and message to the trace listeners in the listeners collection.
Definition debug.hpp:298
static void print(const xtd::string &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition debug.hpp:188
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.hpp:432
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.hpp:380
static listener_collection & listeners() noexcept
Gets the collection of listeners that is monitoring the trace output.
static void write(const xtd::string &format, args_t &&... args)
Writes a formatted string to the trace listeners in the listeners collection.
Definition debug.hpp:309
xtd::diagnostics::trace_listener_collection listener_collection
Represents a collection of xtd::diagnostics::trace_listener.
Definition debug.hpp:65
static bool auto_flush() noexcept
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listener...
static uint32 indent_level() noexcept
Gets the indent level.
static void trace_error(const xtd::string &message, const objects_t &... args)
Writes an error message to the trace listeners in the listeners collection using the specified array ...
Definition debug.hpp:225
static void write_line_if(bool condition, const object_t &message, const xtd::string &category)
Writes a category name and message followed by a line terminator to the trace listeners in the Listen...
Definition debug.hpp:444
static void fail(const xtd::string &message, const xtd::string &detail_message)
Emits an error message and a detailed error message.
Definition debug.hpp:169
static void write_line(const xtd::string &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition debug.hpp:370
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.hpp:339
static void print(const xtd::string &format, args_t &&... args)
Writes a formatted string followed by a line terminator to the trace listeners in the listeners colle...
Definition debug.hpp:198
static void trace_error(const xtd::string &message)
Writes an error message to the trace listeners in the Listeners collection using the specified messag...
Definition debug.hpp:215
static void trace_warning(const xtd::string &message)
Writes a warning message to the trace listeners in the listeners collection using the specified messa...
Definition debug.hpp:253
static void write(const object_t &message)
Writes a message to the trace listeners in the listeners collection.
Definition debug.hpp:286
static void flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition debug.hpp:176
static uint32 indent_size() noexcept
Gets the number of spaces in an indent.
static bool use_global_lock() noexcept
Gets a value indicating whether the global lock should be used.
static void write_line(const xtd::string &format, args_t &&... args)
Writes a formatted string followed by a line terminator to the trace listeners in the listeners colle...
Definition debug.hpp:402
static void unindent() noexcept
Decreases the current indent_level by one.
static void trace_information(const xtd::string &message)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition debug.hpp:234
static void write_line(const object_t &message, const xtd::string &category)
Writes a category name and message followed by a line terminator to the trace listeners in the listen...
Definition debug.hpp:392
static bool show_assert_dialog() noexcept
Gets a value indicating whether the assert dialog should be show.
static void trace_warning(const xtd::string &message, const objects_t &... args)
Writes a warning message to the trace listeners in the listeners collection using the specified array...
Definition debug.hpp:263
static void write_if(bool condition, const xtd::string &message)
Writes a message to the trace listeners in the Listeners collection if a condition is true.
Definition debug.hpp:328
static void write_line_if(bool condition, const xtd::string &message)
Writes a message followed by a line terminator to the trace listeners in the Listeners collection if ...
Definition debug.hpp:421
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:48
static stack_frame current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
Represents a collection of xtd::diagnostics::trace_listener.
Definition trace_listener_collection.hpp:29
Provides a set of methods and properties that help you debug the execution of your code....
Definition trace.hpp:40
static void exit()
Terminates this process and returns an exit code to the operating system.
Contains core_export_ keyword.
Contains xtd::diagnostics::debugger class.
Contains xtd::environment class.
#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
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
assert_dialog_result
Specifies identifiers to indicate the return value of an assert dialog box.
Definition assert_dialog_result.hpp:25
@ retry
The assert dialog return value is Retry (usually sent from a button labeled Retry).
Definition assert_dialog_result.hpp:29
@ abort
The assert dialog return value is Abort (usually sent from a button labeled Abort).
Definition assert_dialog_result.hpp:27
@ warning
Warning Noncritical problem.
Definition trace_event_type.hpp:31
@ information
Informational message.
Definition trace_event_type.hpp:33
@ error
Recoverable error.
Definition trace_event_type.hpp:29
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
void print(FILE *file, arg_t &&value)
Writes the text representation of the specified value to the file output stream.
Definition print.hpp:19
Contains xtd::diagnostics::stack_trace class.
Contains xtd::static_object class.
Contains xtd::string alias.
Contains xtd::diagnostics::trace_listener_collection class.