pub struct LogRender { /* private fields */ }Expand description
Lays out log records. Port of rich._log_render.LogRender.
Implementations§
Source§impl LogRender
impl LogRender
Sourcepub fn new() -> Self
pub fn new() -> Self
Upstream’s defaults: time and path shown, level hidden, repeated times omitted, level column 8 cells wide.
Sourcepub fn show_level(self, show: bool) -> Self
pub fn show_level(self, show: bool) -> Self
Show the level column (upstream show_level).
Sourcepub fn omit_repeated_times(self, omit: bool) -> Self
pub fn omit_repeated_times(self, omit: bool) -> Self
Blank a time equal to the previous record’s (upstream
omit_repeated_times).
Sourcepub fn level_width(self, width: Option<usize>) -> Self
pub fn level_width(self, width: Option<usize>) -> Self
The level column’s width, or None to fit its content (upstream
level_width).
Sourcepub fn render(
&self,
console: &Console,
message: Text,
time: Option<Text>,
level: Text,
path: Option<&str>,
line_no: Option<u32>,
link_path: Option<&str>,
) -> Table
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.
The message is a single Text; render_renderables
takes any renderables, as upstream’s renderables argument does.
Sourcepub fn render_renderables(
&self,
console: &Console,
renderables: Vec<Arc<dyn Renderable + Send + Sync>>,
time: Option<Text>,
level: Text,
path: Option<&str>,
line_no: Option<u32>,
link_path: Option<&str>,
) -> Table
pub fn render_renderables( &self, console: &Console, renderables: Vec<Arc<dyn Renderable + Send + Sync>>, time: Option<Text>, level: Text, path: Option<&str>, line_no: Option<u32>, link_path: Option<&str>, ) -> Table
Lay out one record whose message is any sequence of renderables. Port
of LogRender.__call__ with its renderables argument: they render
one after another in the message column, as upstream’s
Renderables(renderables) cell does. Console.log of a table, a panel
or log_locals’ scope goes through here.