Struct slog_json::JsonBuilder[][src]

pub struct JsonBuilder<W: Write> { /* fields omitted */ }

Json Drain builder

Create with Json::new.

Implementations

impl<W> JsonBuilder<W> where
    W: Write
[src]

pub fn build(self) -> Json<W>[src]

Build Json Drain

This consumes the builder.

pub fn set_newlines(self, enabled: bool) -> Self[src]

Set writing a newline after every log record

pub fn set_flush(self, enabled: bool) -> Self[src]

Enable flushing of the io::Write after every log record

pub fn set_pretty(self, enabled: bool) -> Self[src]

Set whether or not pretty formatted logging should be used

pub fn add_key_value<T>(self, value: OwnedKV<T>) -> Self where
    T: SendSyncRefUnwindSafeKV + 'static, 
[src]

Add custom values to be printed with this formatter

pub fn add_default_keys(self) -> Self[src]

Add default key-values:

  • ts - timestamp
  • level - record logging level name
  • msg - msg - formatted logging message

Auto Trait Implementations

impl<W> RefUnwindSafe for JsonBuilder<W> where
    W: RefUnwindSafe

impl<W> Send for JsonBuilder<W> where
    W: Send

impl<W> Sync for JsonBuilder<W> where
    W: Sync

impl<W> Unpin for JsonBuilder<W> where
    W: Unpin

impl<W> UnwindSafe for JsonBuilder<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.