Shows how to use xtd::diagnostics::stack_frame class.
#include <xtd/diagnostics/stack_frame>
#include <xtd/console>
console::write_line("stack_frame: {}\n", stack_frame);
console::write_line("Message: {}", message);
console::write_line(
"Method: {}", stack_frame.
get_method());
console::write_line(
"File name: {}", stack_frame.
get_file_name());
}
auto main() -> int {
trace_message(
"Something has happened.",
csf_);
}
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
virtual const xtd::string & get_file_name() const noexcept
Gets the file name that contains the code that is executing. This information is typically extracted ...
virtual xtd::size 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::string & 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 namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10