Struct file_rotate::suffix::AppendTimestamp
source · [−]Expand description
Append current timestamp as suffix when rotating files. If the timestamp already exists, an additional number is appended.
Current limitations:
- Neither
format
nor the base filename can include the character"."
. - The
format
should ensure that the lexical and chronological orderings are the same
Fields
format: &'static str
The format of the timestamp suffix
file_limit: FileLimit
The file limit, e.g. when to delete an old file - by age (given by suffix) or by number of files
Implementations
Trait Implementations
type Repr = TimestampSuffix
type Repr = TimestampSuffix
The representation of suffixes that this suffix scheme uses.
E.g. if the suffix is a number, you can use usize
. Read more
fn rotate_file(
&mut self,
_basepath: &Path,
newest_suffix: Option<&TimestampSuffix>,
suffix: &Option<TimestampSuffix>
) -> Result<TimestampSuffix>
fn rotate_file(
&mut self,
_basepath: &Path,
newest_suffix: Option<&TimestampSuffix>,
suffix: &Option<TimestampSuffix>
) -> Result<TimestampSuffix>
file-rotate
calls this function when the file at suffix
needs to be rotated, and moves the log file
accordingly. Thus, this function should not move any files itself. Read more
Whether either the suffix or the chronological file number indicates that the file is old
and should be deleted, depending of course on the file limit.
file_number
starts at 0 for the most recent suffix. Read more