[−][src]Struct color_eyre::BacktracePrinter
Pretty-printer for backtraces and PanicInfo
structs.
Implementations
impl BacktracePrinter
[src]
Builder functions.
pub fn new() -> BacktracePrinter
[src]
Alias for BacktracePrinter::default
.
pub fn color_scheme(self, colors: ColorScheme) -> BacktracePrinter
[src]
Alter the color scheme.
Defaults to ColorScheme::classic()
.
pub fn message(self, message: impl Into<String>) -> BacktracePrinter
[src]
Controls the "greeting" message of the panic.
Defaults to "The application panicked (crashed)"
.
pub fn verbosity(self, v: Verbosity) -> BacktracePrinter
[src]
Controls the verbosity level.
Defaults to Verbosity::from_env()
.
pub fn lib_verbosity(self, v: Verbosity) -> BacktracePrinter
[src]
Controls the lib verbosity level.
Defaults to Verbosity::lib_from_env()
.
pub fn strip_function_hash(self, strip: bool) -> BacktracePrinter
[src]
Controls whether the hash part of functions is stripped.
Defaults to false
.
pub fn add_frame_filter(
self,
filter: Box<dyn Fn(&mut Vec<&Frame>) + 'static + Send + Sync>
) -> BacktracePrinter
[src]
self,
filter: Box<dyn Fn(&mut Vec<&Frame>) + 'static + Send + Sync>
) -> BacktracePrinter
Add a custom filter to the set of frame filters
Filters are run in the order they are added.
Example
use color_backtrace::{default_output_stream, BacktracePrinter}; BacktracePrinter::new() .add_frame_filter(Box::new(|frames| { frames.retain(|x| matches!(&x.name, Some(n) if !n.starts_with("blabla"))) })) .install(default_output_stream());
pub fn clear_frame_filters(self) -> BacktracePrinter
[src]
Clears all filters associated with this printer, including the default filter
impl BacktracePrinter
[src]
Routines for putting the panic printer to use.
pub fn install(self, out: impl Send + Sync + WriteColor + 'static)
[src]
Install the color_backtrace
handler with default settings.
Output streams can be created via default_output_stream()
or
using any other stream that implements
termcolor::WriteColor
.
pub fn into_panic_handler(
self,
out: impl Send + Sync + WriteColor + 'static
) -> Box<dyn Fn(&PanicInfo) + 'static + Send + Sync>
[src]
self,
out: impl Send + Sync + WriteColor + 'static
) -> Box<dyn Fn(&PanicInfo) + 'static + Send + Sync>
Create a color_backtrace
panic handler from this panic printer.
This can be used if you want to combine the handler with other handlers.
pub fn print_trace(
&self,
trace: &Backtrace,
out: &mut impl WriteColor
) -> Result<(), Error>
[src]
&self,
trace: &Backtrace,
out: &mut impl WriteColor
) -> Result<(), Error>
Pretty-prints a backtrace::Backtrace
to an output stream.
pub fn format_trace_to_string(&self, trace: &Backtrace) -> Result<String, Error>
[src]
Pretty-print a backtrace to a String
, using VT100 color codes.
pub fn print_panic_info(
&self,
pi: &PanicInfo,
out: &mut impl WriteColor
) -> Result<(), Error>
[src]
&self,
pi: &PanicInfo,
out: &mut impl WriteColor
) -> Result<(), Error>
Pretty-prints a PanicInfo
struct to an output stream.
Trait Implementations
impl Default for BacktracePrinter
[src]
fn default() -> BacktracePrinter
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BacktracePrinter
impl Send for BacktracePrinter
impl Sync for BacktracePrinter
impl Unpin for BacktracePrinter
impl !UnwindSafe for BacktracePrinter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,