hyperion::assert::backtrace#
- group backtrace
Hyperion provides
Backtrace
as a convenient type for generating a backtrace.Example#
// calculate the backtrace up to this point auto backtrace = hyperion::Backtrace{}; // no syntax highlighting fmt::print(stdout, "{}", backtrace); // with syntax highlighting fmt::print(stdout, "{}", hyperion::format_backtrace(backtrace, hyperion::backtrace::FormatStyle::Styled));
Note
hyperion::Backtrace
is currently an alias forboost::stacktrace::stacktrace
, but Hyperion reserves the right to change this at any time (with respect to semantic versioning)Typedefs
-
using Backtrace = boost::stacktrace::stacktrace#
Backtrace
provides a full backtrace of the current call stack at the point of its constructor invocation
Enums
Functions
-
auto format_backtrace(const Backtrace &backtrace, backtrace::FormatStyle style = backtrace::FormatStyle::Unstyled) -> std::string#
Formats a
Backtrace
into a string according to the given format style.- Parameters:
backtrace – The
Backtrace
to formatstyle – The style to format the backtrace in (i.e. syntax highlighted, or unstyled)
- Returns:
The formatted
Backtrace
-
using Backtrace = boost::stacktrace::stacktrace#