Struct slog_json::Json [] [src]

pub struct Json {
    // some fields omitted
}

Json formatter

Each record will be printed as a Json map.

Methods

impl Json
[src]

fn new() -> Self

Create new Json format.

It comes with some default fields (ts, level, msg) and uses newlines.

Use Json::build() to build a custom Json formatter from scratch.

fn build() -> JsonBuilder

Build a Json formatter with custom settings

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, io: &mut Write, rinfo: &RecordInfo, logger_values: &OwnedKeyValueNode) -> Result<()>

Format one logging record and write into io