Skip to content

Commit ac5d5af

Browse files
committed
docs: document special meaning of 0 for max_files
1 parent 5e541d9 commit ac5d5af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tracing-appender/src/rolling/builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl Builder {
195195
/// the maximum, so if you need to retain `m` log files, specify a max of
196196
/// `m + 1`.
197197
///
198-
/// If no value is supplied, the `RollingAppender` will not remove any files.
198+
/// If `0` is supplied, the `RollingAppender` will not remove any files.
199199
///
200200
/// Files are considered candidates for deletion based on the following
201201
/// criteria:
@@ -232,6 +232,7 @@ impl Builder {
232232
#[must_use]
233233
pub fn max_log_files(self, n: usize) -> Self {
234234
Self {
235+
// Setting `n` to 0 will disable the max files (effectively make it infinite).
235236
max_files: Some(n).filter(|&n| n > 0),
236237
..self
237238
}

0 commit comments

Comments
 (0)