diff options
Diffstat (limited to 'library/backtrace/src/print.rs')
-rw-r--r-- | library/backtrace/src/print.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/library/backtrace/src/print.rs b/library/backtrace/src/print.rs index 174d8ae5c..8d9cbe3d4 100644 --- a/library/backtrace/src/print.rs +++ b/library/backtrace/src/print.rs @@ -86,6 +86,23 @@ 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) + } + + /// Return the inner formatter. + /// + /// This is used for writing custom information between frames with `write!` and `writeln!`, + /// and won't increment the `frame_index` unlike the `frame` method. + pub fn formatter(&mut self) -> &mut fmt::Formatter<'b> { + self.fmt + } } /// A formatter for just one frame of a backtrace. |