Shows how to use xtd::diagnostics::stack_frame class.
#include <xtd/xtd.tunit>
void trace_message(
const string& message,
const stack_frame& sf = stack_frame::current()) {
console::out << "message: " << message << environment::new_line;
console::out << "member name: " << sf.get_method() << environment::new_line;
console::out << "source file path: " << sf.get_file_name() << environment::new_line;
console::out << "source line number: " << sf.get_file_line_number() << environment::new_line;
}
auto main() -> int {
trace_message("Something happened.");
}
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:47
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10