Skip to content

Commit 102fedf

Browse files
authored
Merge pull request #527 from chenyukang/yukang-add-print
2 parents e9ef7d8 + 9520eee commit 102fedf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/print.rs

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
8686
// Currently a no-op-- including this hook to allow for future additions.
8787
Ok(())
8888
}
89+
90+
/// Inserts a message in the backtrace output.
91+
///
92+
/// This allows information to be inserted between frames,
93+
/// and won't increment the `frame_index` unlike the `frame`
94+
/// method.
95+
pub fn message(&mut self, msg: &str) -> fmt::Result {
96+
self.fmt.write_str(msg)
97+
}
8998
}
9099

91100
/// A formatter for just one frame of a backtrace.

0 commit comments

Comments
 (0)