Struct slog_json::JsonBuilder [−][src]
Json Drain
builder
Create with Json::new
.
Implementations
impl<W> JsonBuilder<W> where
W: Write,
[src]
W: Write,
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]
T: SendSyncRefUnwindSafeKV + 'static,
Add custom values to be printed with this formatter
pub fn add_default_keys(self) -> Self
[src]
Add default key-values:
ts
- timestamplevel
- record logging level namemsg
- msg - formatted logging message
Auto Trait Implementations
impl<W> RefUnwindSafe for JsonBuilder<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for JsonBuilder<W> where
W: Send,
W: Send,
impl<W> Sync for JsonBuilder<W> where
W: Sync,
W: Sync,
impl<W> Unpin for JsonBuilder<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for JsonBuilder<W> where
W: UnwindSafe,
W: UnwindSafe,
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,
pub 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> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
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.
pub 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>,