pub struct Backtrace { /* private fields */ }
Expand description
System-agnostic backtrace type
Implementations§
Source§impl Backtrace
impl Backtrace
Sourcepub fn as_string(&self) -> String
pub fn as_string(&self) -> String
Get the backtrace as a string
Examples found in repository?
examples/demo.rs (line 18)
8fn main() {
9 multiline_logger::Settings {
10 title: "logger test",
11 filters: &[("", LevelFilter::Trace)],
12 file_out: Some(Path::new("target/test.log")),
13 console_out: true,
14 #[expect(clippy::print_stdout, reason = "demo")]
15 panic_hook: Some(|info| {
16 println!(
17 "Custom panic handler\nPanic info: {info:?}\nBacktrace: {:?}",
18 info.trace.as_string()
19 );
20 }),
21 }
22 .init();
23 log::trace!("Trace\n");
24 log::debug!("Debug\n{:?}", [1, 2, 3, 4]);
25 log::info!("Info: {}", 7);
26 log::warn!("Warn {:#?}", [0, 9, 8, 7]);
27 log::error!("Error");
28 panic!("Panic Message");
29}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Backtrace
impl RefUnwindSafe for Backtrace
impl Send for Backtrace
impl Sync for Backtrace
impl Unpin for Backtrace
impl UnwindSafe for Backtrace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more