pub struct SlogLogger { /* private fields */ }
Expand description

A logger using the slog crate as backend.

Implementations

Log to the terminal.

Will block execution when buffer is full.

Example
use argmin::core::observers::SlogLogger;

let terminal_logger = SlogLogger::term();

Log to the terminal without blocking execution.

Messages may be lost in case of buffer overflow.

Example
use argmin::core::observers::SlogLogger;

let terminal_logger = SlogLogger::term_noblock();

Log JSON to a file while blocking execution in case of full buffers.

If truncate is set to true, the content of existing log files will be cleared.

Only available if the serde1 feature is set.

Example
use argmin::core::observers::SlogLogger;

let file_logger = SlogLogger::file("logfile.log", true);

Log JSON to a file without blocking execution.

Messages may be lost in case of buffer overflow.

If truncate is set to true, the content of existing log files will be cleared.

Only available if the serde1 feature is set.

Example
use argmin::core::observers::SlogLogger;

let file_logger = SlogLogger::file_noblock("logfile.log", true);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Log basic information about the optimization after initialization.

Logs information about the progress of the optimization after every iteration.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.