Struct spdlog::sink::WriteSink

source ·
pub struct WriteSink<W>where
    W: Write + Send,
{ /* private fields */ }
Expand description

A sink that writes log messages into an arbitrary impl Write object.

Performance Notice

Since WriteSink can write into any impl Write objects, the assumptions made on the underlying impl Write object is very weak and this does impact performance. You should use other sinks or implement your own sinks whenever possible. WriteSink is your last resort if no other sinks meet your requirement.

If you want to log into a file, use FileSink or RotatingFileSink instead.

If you want to log into the standard streams, use StdStreamSink instead.

Implementations

Constructs a builder of WriteSink.

Invoke a callback function with the underlying impl Write object.

This function returns whatever the given callback function returns.

Note that this sink cannot write into the underlying impl Write object while the given callback function is running. If the underlying impl Write object supports a relatively cheap clone operation, consider using the clone_target method.

Clone the underlying impl Write object.

Trait Implementations

Executes the destructor for this type. Read more
Logs a record. Read more
Flushes any buffered records.
Gets the log level filter.
Sets the log level filter.
Sets the formatter.
Sets a error handler. Read more
Determines if a log message with the specified level would be logged.

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 alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. 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.