Skip to content

Commit 5646cbf

Browse files
committed
Merge branch 'main' into hds/fmtspan-docs
2 parents c7ccd69 + adbd8a4 commit 5646cbf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tracing-appender/src/rolling/builder.rs

Lines changed: 3 additions & 2 deletions
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,7 +232,8 @@ impl Builder {
232232
#[must_use]
233233
pub fn max_log_files(self, n: usize) -> Self {
234234
Self {
235-
max_files: Some(n),
235+
// Setting `n` to 0 will disable the max files (effectively make it infinite).
236+
max_files: Some(n).filter(|&n| n > 0),
236237
..self
237238
}
238239
}

tracing-subscriber/src/fmt/format/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ impl<F> fmt::Debug for FieldFnVisitor<'_, F> {
16021602
///
16031603
/// See also [`with_span_events`].
16041604
///
1605-
/// [`with_span_events`]: (super::SubscriberBuilder::with_span_events)
1605+
/// [`with_span_events`]: super::SubscriberBuilder::with_span_events
16061606
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
16071607
pub struct FmtSpan(u8);
16081608

0 commit comments

Comments
 (0)