Struct slog::format::Json [] [src]

pub struct Json {
    // some fields omitted
}

ToJson formatter

Each record will be printed as a Json map.

Methods

impl Json
[src]

fn new() -> Self

Create new Json format.

TODO: Add a builder pattern to configure newlines, and custom records.

fn new_nonewline() -> Self

Create new Json format that does not add newlines after each record.

Trait Implementations

impl Format for Json
[src]

fn format(&self, rinfo: &RecordInfo, logger_values: &[OwnedKeyValue], record_values: &[BorrowedKeyValue]) -> String

Format one logging record into String