pub struct Stdout { /* private fields */ }
Expand description
An appender that writes log records to standard output.
§Examples
use logforth::append::Stdout;
let stdout_appender = Stdout::default();
Implementations§
Source§impl Stdout
impl Stdout
Sourcepub fn with_layout(self, layout: impl Into<Box<dyn Layout>>) -> Self
pub fn with_layout(self, layout: impl Into<Box<dyn Layout>>) -> Self
Sets the layout for the Stdout
appender.
§Examples
use logforth::append::Stdout;
use logforth::layout::TextLayout;
let stdout_appender = Stdout::default().with_layout(TextLayout::default());
Examples found in repository?
More examples
examples/custom_layout_filter.rs (line 49)
45fn main() {
46 logforth::builder()
47 .dispatch(|d| {
48 d.filter(CustomFilter)
49 .append(append::Stdout::default().with_layout(CustomLayout))
50 })
51 .apply();
52
53 log::error!("Hello error!");
54 log::warn!("Hello warn!");
55 log::info!("Hello info!");
56 log::debug!("Hello debug!");
57 log::trace!("Hello trace!");
58}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stdout
impl !RefUnwindSafe for Stdout
impl Send for Stdout
impl Sync for Stdout
impl Unpin for Stdout
impl !UnwindSafe for Stdout
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request