Skip to content

Commit

Permalink
Add message in BacktraceFmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Jun 19, 2023
1 parent 4245978 commit 494cabe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
// Currently a no-op-- including this hook to allow for future additions.
Ok(())
}

/// Inserts a message in the backtrace output.
///
/// This allows information to be inserted between frames,
/// and won't increment the `frame_index` unlike the `frame`
/// method.
pub fn message(&mut self, msg: &str) -> fmt::Result {
self.fmt.write_str(msg)
}
}

/// A formatter for just one frame of a backtrace.
Expand Down

0 comments on commit 494cabe

Please sign in to comment.