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

A configurable LogWriter implementation that writes to a file or a sequence of files.

See writers for usage guidance.

Implementations

Instantiates a builder for FileLogWriter.

Returns a reference to its configured output format function.

Replaces parts of the configuration of the file log writer.

Note that the write mode and the format function cannot be reset and that the provided FileLogWriterBuilder must have the same values for these as the current FileLogWriter.

Errors

FlexiLoggerError::Reset if a reset was tried with a different write mode.

FlexiLoggerError::Io if the specified path doesn’t work.

FlexiLoggerError::OutputBadDirectory if the specified path is not a directory.

FlexiLoggerError::Poison if some mutex is poisoned.

Returns the current configuration of the file log writer

Errors

FlexiLoggerError::Poison if some mutex is poisoned.

Makes the FileLogWriter re-open the current log file.

FileLogWriter expects that nobody else modifies the file to which it writes, and offers capabilities to rotate, compress, and clean up log files.

However, if you use tools like linux’ logrotate to rename or delete the current output file, you need to inform the FileLogWriter about such actions by calling this method. Otherwise the FileLogWriter will not stop writing to the renamed or even deleted file!

Example

logrotate e.g. can be configured to send a SIGHUP signal to your program. You should handle SIGHUP in your program explicitly, e.g. using a crate like ctrlc, and call this function from the registered signal handler.

Errors

FlexiLoggerError::Poison if some mutex is poisoned.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Writes out a log line. Read more

Flushes any buffered records. Read more

Provides the maximum log level that is to be written.

Cleanup open resources, if necessary.

Sets the format function. 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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more