7#include "../add_last_arg_to_command.h"
8#include "../core_export.h"
9#include "../environment.h"
26 namespace diagnostics {
80 static
void auto_flush(
bool auto_flush) noexcept;
85 static
uint32 indent_level() noexcept;
89 static
void indent_level(
uint32 indent_level) noexcept;
94 static
uint32 indent_size() noexcept;
98 static
void indent_size(
uint32 indent_size) noexcept;
117 static
bool show_assert_dialog() noexcept;
124 static
void show_assert_dialog(
bool show_assert_dialog) noexcept;
129 static
bool use_global_lock() noexcept;
133 static
void use_global_lock(
bool use_global_lock) noexcept;
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)
188 static
void print(const
xtd::
string& message) {
189 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
190 write_line_(message);
197 template<
typename ...args_t>
199 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
204 template<
typename ...args_t>
205 static void print(
const char* format, args_t&& ... args) {
206 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
216 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
217 trace_event_(trace_event_type::error, message);
224 template<
typename ...objects_t>
226 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
235 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
236 trace_event_(trace_event_type::information, message);
243 template<
typename ...objects_t>
245 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
254 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
255 trace_event_(trace_event_type::warning, message);
262 template<
typename ...objects_t>
264 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
276 static
void write(const
xtd::
string& message) {
277 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
285 template<
typename object_t>
286 static void write(
const object_t& message) {
287 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
297 template<
typename object_t>
299 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
308 template<
typename ...args_t>
310 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
311 write_(string::format(format, args...));
315 template<
typename ...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<
typename object_t>
339 static void write_if(
bool condition,
const object_t& message) {
340 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
350 template<
typename object_t>
352 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
362 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
371 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
372 write_line_(message);
379 template<
typename object_t>
381 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
391 template<
typename object_t>
393 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
401 template<
typename ...args_t>
403 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
404 write_line_(string::format(format, args...));
408 template<
typename ...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<
typename object_t>
433 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
434 if (condition) write_line_(message);
443 template<
typename 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);
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 xtd::diagnostics::assert_dialog_result enum class.
Represents text as a sequence of character units.
Definition basic_string.h:79
static const basic_string empty_string
Represents the empty basic_string.
Definition basic_string.h:124
Provides a set of methods and properties that help you debug the execution of your code....
Definition debug.h:59
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.h: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.h:244
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.h:361
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.h:298
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: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.h:380
static void write(const xtd::string &format, args_t &&... args)
Writes a formatted string to the trace listeners in the listeners collection.
Definition debug.h:309
static bool auto_flush() noexcept
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listener...
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.h: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.h:444
static void fail(const xtd::string &message, const xtd::string &detail_message)
Emits an error message and a detailed error message.
Definition debug.h: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.h: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.h: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.h: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.h: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.h:253
static void write(const object_t &message)
Writes a message to the trace listeners in the listeners collection.
Definition debug.h:286
static void flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition debug.h:176
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.h: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.h: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.h:392
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.h: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.h: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.h:421
Provides the default output methods and behavior for tracing.
Definition default_trace_listener.h:33
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
static stack_frame current(const xtd::source_location &value=xtd::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.h:29
static void exit()
Terminates this process and returns an exit code to the operating system.
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:114
Contains xtd::diagnostics::debugger class.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
#define core_export_
Define shared library export.
Definition core_export.h:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
assert_dialog_result
Specifies identifiers to indicate the return value of an assert dialog box.
Definition assert_dialog_result.h:25
@ 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).
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::diagnostics::stack_trace class.
Contains xtd::diagnostics::trace_listener_collection class.