10 namespace diagnostics {
59 static
void auto_flush(
bool auto_flush) noexcept;
64 static
uint32 indent_level() noexcept;
68 static
void indent_level(
uint32 indent_level) noexcept;
73 static
uint32 indent_size() noexcept;
77 static
void indent_size(
uint32 indent_size) noexcept;
96 static
bool show_assert_dialog() noexcept;
103 static
void show_assert_dialog(
bool show_assert_dialog) noexcept;
108 static
bool use_global_lock() noexcept;
112 static
void use_global_lock(
bool use_global_lock) noexcept;
123 static
void cassert(
bool condition);
127 static
void cassert(
bool condition, const
xtd::
ustring& message);
165 fail__(message, detail_message);
183 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
184 write_line_(message);
191 template<
typename ...args_t>
193 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
198 template<
typename ...args_t>
199 static void print(
const char* format, args_t&& ... args) {
200 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
210 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
211 trace_event_(trace_event_type::error, message);
218 template<
typename ...objects>
220 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
221 trace_event_(trace_event_type::error, message, args...);
229 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
230 trace_event_(trace_event_type::information, message);
237 template<
typename ...objects>
239 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
248 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
249 trace_event_(trace_event_type::warning, message);
256 template<
typename ...objects>
258 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
280 template<
typename object_t>
281 static void write(
const object_t& message) {
292 template<
typename object_t>
303 template<
typename ...args_t>
306 write_(ustring::format(format, args...));
310 template<
typename ...args_t>
311 static void write(
const char* format, args_t&& ... args) {
313 write_(ustring::format(format, args...));
325 if (condition) write_(message);
333 template<
typename object_t>
334 static void write_if(
bool condition,
const object_t& message) {
345 template<
typename object_t>
367 write_line_(message);
374 template<
typename object_t>
386 template<
typename object_t>
396 template<
typename ...args_t>
403 template<
typename ...args_t>
404 static void write_line(
const char* format, args_t&& ... args) {
418 if (condition) write_line_(message);
426 template<
typename object_t>
438 template<
typename object_t>
447 static inline bool __should_aborted__(
bool condition) {
return __should_aborted__(condition,
"",
csf_); }
448 static inline bool __should_aborted__(
bool condition,
const xtd::ustring& message) {
return __should_aborted__(condition, message,
csf_);}
449 static inline bool __should_aborted__(
bool condition,
const xtd::diagnostics::stack_frame& stack_frame) {
return __should_aborted__(condition,
"", stack_frame);}
451 static inline bool __should_aborted__(
bool condition,
const xtd::ustring& message,
const xtd::ustring& detail_message) {
return __should_aborted__(condition, message, detail_message,
csf_);}
454 auto result = xtd::diagnostics::debug::assert_dialog(condition, message, detail_message, stack_frame);
465 static void flush_();
466 static void trace_event_(trace_event_type trace_event_type,
const xtd::ustring& message);
472 inline static bool auto_flush_ =
false;
473 inline static uint32 indent_level_ = 0;
474 inline static uint32 indent_size_ = 4;
475 static listener_collection& listeners_;
476 inline static bool use_global_lock_ =
true;
Provides the default output methods and behavior for tracing.
Definition default_trace_listener.h:31
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:37
Represents a collection of xtd::diagnostics::trace_listener.
Definition trace_listener_collection.h:27
Provides a set of methods and properties that help you debug the execution of your code....
Definition trace.h:38
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 trace.h:293
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.h:356
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:304
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:238
static bool auto_flush() noexcept
Gets whether Flush should be called on the Listeners after every write.
static void fail(const xtd::ustring &message, const xtd::ustring &detail_message)
Emits an error message and a detailed error message.
Definition trace.h:163
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 trace.h:427
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:219
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:365
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:247
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:209
static void write(const object_t &message)
Writes a message to the trace listeners in the listeners collection.
Definition trace.h:281
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 trace.h:334
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 trace.h:346
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:192
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:257
static void flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition trace.h:170
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 trace.h:387
static void unindent() noexcept
Decreases the current indent_level by one.
static void indent() noexcept
Increases the current indent_level by one.
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:228
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:416
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 trace.h:439
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 trace.h:375
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:323
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:397
static void exit()
Terminates this process and returns an exit code to the operating system.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:110
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:37
#define core_export_
Define shared library export.
Definition core_export.h:13
#define csf_
Provides information about the current stack frame.
Definition current_stack_frame.h:30
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition types.h:241
@ 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