xtd 0.2.0
console_trace_listener.cpp

Shows how to use xtd::diagnostics::console_trace_listener class.

#define DEBUG // Force debug mode even if example is builded in release.
#include <xtd/diagnostics/debug>
#include <xtd/diagnostics/console_trace_listener>
#include <xtd/threading/thread>
#include <memory>
using namespace xtd;
using namespace xtd::diagnostics;
auto main() -> int {
for (auto step = 1; step <= 10; step++) {
debug::write_line("working step {}...", step);
}
}
// This code produces the following output :
//
// Begin
// working step 1...
// working step 2...
// working step 3...
// working step 4...
// working step 5...
// working step 6...
// working step 7...
// working step 8...
// working step 9...
// working step 10...
// End
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 void unindent() noexcept
Decreases the current indent_level by one.
static void sleep(int32 milliseconds_timeout)
Suspends the current thread for a specified time.
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