xtd 0.2.0
Loading...
Searching...
No Matches
trace.cpp

Shows how to use trace class.

// Specify -DTRACE when compiling or add #define TRACE in the source file.
#define DEBUG
#include <xtd/diagnostics/trace>
#include <xtd/diagnostics/ostream_trace_listener>
#include <xtd/console>
using namespace xtd;
using namespace xtd::diagnostics;
auto main() -> int {
trace::listeners().push_back(new_ptr<ostream_trace_listener>(console::out));
trace::auto_flush(true);
trace::indent();
trace::write_line("Entering Main");
console::write_line("Hello World.");
trace::write_line("Exiting Main");
trace::unindent();
}
// This code produces the following output :
//
// Entering Main
// Hello World.
// Exiting Main
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 xtd_about_box.hpp:10