Skip to content

Commit

Permalink
docs: manually fixup docs
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Oct 30, 2024
1 parent 259688a commit 52a134c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/append/rolling_file/non_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl NonBlockingBuilder {

/// Override the worker thread's name.
///
/// The default worker thread name is "tracing-appender".
/// The default worker thread name is "logforth-rolling-file".
pub fn thread_name(mut self, name: impl Into<String>) -> NonBlockingBuilder {
self.thread_name = name.into();
self
Expand Down
24 changes: 12 additions & 12 deletions src/logger/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,33 @@ pub fn builder() -> Builder {
Builder::new()
}

/// Creates a [`Builder`] with a default [`append::Stderr`] appender and an [`env_filter`](https://crates.io/crates/env_filter)
/// Creates a [`Builder`] with a default [`append::Stdout`] appender and an [`env_filter`](https://crates.io/crates/env_filter)
/// respecting `RUST_LOG`.
///
/// # Examples
///
/// ```
/// logforth::stderr().apply();
/// log::error!("This error will be logged to stderr.");
/// logforth::stdout().apply();
/// log::error!("This error will be logged to stdout.");
/// ```
pub fn stdout() -> Builder {
crate::builder().dispatch(|d| {
builder().dispatch(|d| {
d.filter(EnvFilter::from_default_env())
.append(append::Stdout::default())
})
}

/// Creates a [`Builder`] with a default [`append::Stdout`] appender and an [`env_filter`](https://crates.io/crates/env_filter)
/// Creates a [`Builder`] with a default [`append::Stderr`] appender and an [`env_filter`](https://crates.io/crates/env_filter)
/// respecting `RUST_LOG`.
///
/// # Examples
///
/// ```
/// logforth::stdout().apply();
/// log::info!("This info will be logged to stdout.");
/// logforth::stderr().apply();
/// log::info!("This info will be logged to stderr.");
/// ```
pub fn stderr() -> Builder {
crate::builder().dispatch(|d| {
builder().dispatch(|d| {
d.filter(EnvFilter::from_default_env())
.append(append::Stderr::default())
})
Expand Down Expand Up @@ -116,9 +116,9 @@ impl Builder {
self
}

/// Sets the global maximum log level.
/// Sets the global maximum log level. Default to [`LevelFilter::Trace`].
///
/// This will bypass to `log::set_max_level()`.
/// This will be passed to `log::set_max_level()`.
///
/// # Examples
///
Expand Down Expand Up @@ -204,7 +204,7 @@ impl DispatchBuilder<false> {
}
}

/// Sets the filter for this dispatch.
/// Add a filter to this dispatch.
///
/// # Examples
///
Expand All @@ -231,7 +231,7 @@ impl DispatchBuilder<true> {
}

impl<const APPEND: bool> DispatchBuilder<APPEND> {
/// Appends an appender to this dispatch.
/// Add an appender to this dispatch.
///
/// # Examples
///
Expand Down

0 comments on commit 52a134c

Please sign in to comment.