Struct bflog::ContextWriter

source ·
pub struct ContextWriter<'a> { /* private fields */ }
Expand description

Temporary structure that can write additional context to a log entry.

Implementations§

Sets the context writer to “pretty” mode, which outputs each context item on a separate line with pretty formatting.

Adds a context item with a given key and value to the log entry.

This method is identical to write but is better named when the method is repeatedly chained from a logger method.

Writes a context item with a given key and value to the log entry.

This method is identical to with but is better named when the writer is stored in a variable and used procedurally.

Completes the log entry.

This method does nothing, but serves as an easy way to drop a writer stored in a variable without the need for a block.

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.