Shows how to use xtd::diagnostics::stack_frame class and csf_ keyword.
#include <xtd/xtd.tunit>
#include <iostream>
using namespace std;
void trace_message(
const string& message,
const stack_frame& sf) {
cout << "message: " << message << endl;
cout <<
"member name: " << sf.
get_method() << endl;
}
auto main()->int {
trace_message(
"Something happened.",
csf_);
}
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:37
virtual uint32 get_file_line_number() const noexcept
Gets the line number in the file that contains the code that is executing. This information is typica...
virtual const xtd::ustring & get_file_name() const noexcept
Gets the file name that contains the code that is executing. This information is typically extracted ...
virtual const xtd::ustring & get_method() const noexcept
Gets the method in which the frame is executing.
#define csf_
Provides information about the current stack frame.
Definition current_stack_frame.h:30
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.h:10
The tunit namespace contains a unit test library.
Definition abort_error.h:10