xtd 0.2.0
debug.cpp

Shows how to use debug class.

// Specify -DDEBUG when compiling or add #define DEBUG in the source file.
#include <xtd/diagnostics/debug>
#include <xtd/diagnostics/ostream_trace_listener>
#include <xtd/console>
using namespace xtd;
using namespace xtd::diagnostics;
auto main() -> int {
debug::write_line("Entering Main");
console::write_line("Hello World.");
debug::write_line("Exiting Main");
}
// This code produces the following output :
//
// Entering Main
// Hello World.
// Exiting Main
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
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 listener_collection & listeners() noexcept
Gets the collection of listeners that is monitoring the trace output.
static bool auto_flush() noexcept
Gets whether xtd::diagnostics::debug::flush should be called on the xtd::diagnostics::debug::Listener...
static void unindent() noexcept
Decreases the current indent_level by one.
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
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