97 [[deprecated(
"Replaced by xtd::diagnostics::default_trace_listener::assert_ui_enabled - Will be removed in version 0.4.0.")]]
104 [[deprecated(
"Replaced by xtd::diagnostics::default_trace_listener::assert_ui_enabled - Will be removed in version 0.4.0.")]]
140 static
void fail(const
xtd::
string& message) {
152 fail__(message, detail_message);
170 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
171 write_line_(message);
178 template<
class ...args_t>
180 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
181 write_line_(xtd::string::format(
format, args...));
185 template<
class ...args_t>
186 static void print(
const char*
format, args_t&& ... args) {
187 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
188 write_line_(xtd::string::format(
format, args...));
197 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
205 template<
class ...objects>
207 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
216 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
224 template<
class ...objects>
226 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
235 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
243 template<
class ...objects>
245 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
267 template<
class object_t>
268 static void write(
const object_t& message) {
270 write_(xtd::string::format(
"{}", message));
268 static void write(
const object_t& message) {
…}
279 template<
class object_t>
282 write_(xtd::string::format(
"{}", message), category);
290 template<
class ...args_t>
293 write_(string::format(
format, args...));
297 template<
class ...args_t>
298 static void write(
const char*
format, args_t&& ... args) {
300 write_(string::format(
format, args...));
312 if (condition) write_(message);
320 template<
class object_t>
321 static void write_if(
bool condition,
const object_t& message) {
323 if (condition) write_(xtd::string::format(
"{}", message));
321 static void write_if(
bool condition,
const object_t& message) {
…}
332 template<
class object_t>
335 if (condition) write_(xtd::string::format(
"{}", message), category);
354 write_line_(message);
361 template<
class object_t>
364 write_line_(xtd::string::format(
"{}", message));
373 template<
class object_t>
376 write_line_(xtd::string::format(
"{}", message), category);
383 template<
class ...args_t>
386 write_line_(xtd::string::format(
format, args...));
390 template<
class ...args_t>
391 static void write_line(
const char*
format, args_t&& ... args) {
393 write_line_(xtd::string::format(
format, args...));
405 if (condition) write_line_(message);
413 template<
class object_t>
416 if (condition) write_line_(xtd::string::format(
"{}", message));
425 template<
class object_t>
428 if (condition) write_line_(xtd::string::format(
"{}", message), category);
438 auto result = xtd::diagnostics::debug::assert_dialog(condition, message, detail_message, stack_frame);
449 static void flush_();
450 static void trace_event_(trace_event_type trace_event_type,
const xtd::string& message);
453 static void write_line_(
const xtd::string& message);
456 inline static bool auto_flush_ =
false;
457 inline static uint32 indent_level_ = 0;
458 inline static uint32 indent_size_ = 4;
459 static listener_collection& listeners_;
460 inline static bool use_global_lock_ =
true;
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 uint32 indent_size() noexcept
Gets the number of spaces in an indent.
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:343
static void trace_information(const xtd::string &message, const objects &... args)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition trace.hpp:225
static bool use_global_lock() noexcept
Gets a value indicating whether the global lock should be used.
static bool auto_flush() noexcept
Gets whether Flush should be called on the Listeners after every write.
static void write(const xtd::string &format, args_t &&... args)
Writes a formatted string to the trace listeners in the listeners collection.
Definition trace.hpp:291
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 trace.hpp:352
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 trace.hpp:384
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.hpp:414
static void trace_error(const xtd::string &message, const objects &... args)
Writes an error message to the trace listeners in the listeners collection using the specified array ...
Definition trace.hpp:206
static uint32 indent_level() noexcept
Gets the indent level.
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 trace.hpp:196
static void trace_information(const xtd::string &message)
Writes an informational message to the trace listeners in the listeners collection using the specifie...
Definition trace.hpp:215
static void write(const xtd::string &message)
Writes a message to the trace listeners in the listeners collection.
Definition trace.hpp:257
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 listener_collection & listeners() noexcept
Gets the collection of listeners that is monitoring the trace output.
static bool show_assert_dialog() noexcept
Gets a value indicating whether the assert dialog should be show.
xtd::diagnostics::trace_listener_collection listener_collection
Represents a collection of xtd::diagnostics::trace_listener.
Definition trace.hpp:46
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 trace.hpp:234
static void write(const object_t &message)
Writes a message to the trace listeners in the listeners collection.
Definition trace.hpp:268
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.hpp:321
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 trace.hpp:426
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 trace.hpp:374
static void fail(const xtd::string &message)
Emits the specified error message.
Definition trace.hpp:140
static void flush()
Flushes the output buffer and causes buffered data to write to the listeners collection.
Definition trace.hpp:157
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 trace.hpp:179
static void fail(const xtd::string &message, const xtd::string &detail_message)
Emits an error message and a detailed error message.
Definition trace.hpp:150
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 trace.hpp:310
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 trace.hpp:280
static void trace_warning(const xtd::string &message, const objects &... args)
Writes a warning message to the trace listeners in the listeners collection using the specified array...
Definition trace.hpp:244
static void unindent() noexcept
Decreases the current indent_level by one.
static void indent() noexcept
Increases the current indent_level by one.
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 trace.hpp:403
static void print(const xtd::string &message)
Writes a message followed by a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:169
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.hpp:362
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 trace.hpp:333
static void exit()
Terminates this process and returns an exit code to the operating system.
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.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
@ 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