Skip to content

Commit

Permalink
Add print_with_snippets to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Mar 16, 2024
1 parent a528aa8 commit 8407adf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ The core resolved stack trace object. Generate a trace with `cpptrace::generate_
`cpptrace::stacktrace::current()`. On top of a set of helper functions `struct stacktrace` allows
direct access to frames as well as iterators.

`cpptrace::stacktrace::print` can be used to print a stacktrace. `cpptrace::stacktrace::print_with_snippets` can be used
to print a stack trace with source code snippets.

```cpp
namespace cpptrace {
// Some type sufficient for an instruction pointer, currently always an alias to std::uintptr_t
Expand Down Expand Up @@ -190,6 +193,9 @@ namespace cpptrace {
void print() const;
void print(std::ostream& stream) const;
void print(std::ostream& stream, bool color) const;
void print_with_snippets() const;
void print_with_snippets(std::ostream& stream) const;
void print_with_snippets(std::ostream& stream, bool color) const;
std::string to_string(bool color = false) const;
void clear();
bool empty() const noexcept;
Expand Down

0 comments on commit 8407adf

Please sign in to comment.