Skip to main content

LogRender

Struct LogRender 

Source
pub struct LogRender { /* private fields */ }
Expand description

Lays out log records. Port of rich._log_render.LogRender.

Implementations§

Source§

impl LogRender

Source

pub fn new() -> Self

Upstream’s defaults: time and path shown, level hidden, repeated times omitted, level column 8 cells wide.

Source

pub fn show_time(self, show: bool) -> Self

Show the time column (upstream show_time).

Source

pub fn show_level(self, show: bool) -> Self

Show the level column (upstream show_level).

Source

pub fn show_path(self, show: bool) -> Self

Show the path column (upstream show_path).

Source

pub fn omit_repeated_times(self, omit: bool) -> Self

Blank a time equal to the previous record’s (upstream omit_repeated_times).

Source

pub fn level_width(self, width: Option<usize>) -> Self

The level column’s width, or None to fit its content (upstream level_width).

Source

pub fn render( &self, console: &Console, message: Text, time: Option<Text>, level: Text, path: Option<&str>, line_no: Option<u32>, link_path: Option<&str>, ) -> Table

Lay out one record. Port of LogRender.__call__: time is the formatted log time, level the styled level text (see level_text), and link_path makes the path a file:// hyperlink.

Trait Implementations§

Source§

impl Default for LogRender

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.