Skip to content

Commit

Permalink
docs(fmt): Talk about new styling API
Browse files Browse the repository at this point in the history
The documentation for the old API was overlooked in #298
  • Loading branch information
epage committed Feb 13, 2024
1 parent 62713d1 commit c67579c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
//!
//! The format used to print log records can be customised using the [`Builder::format`]
//! method.
//! Custom formats can apply different color and weight to printed values using
//! [`Style`] builders.
//!
//! Terminal styling is done through ANSI escape codes and will be adapted to the capabilities of
//! the target stream.
//! For example, you could use one of:
//! - [anstyle](https://docs.rs/anstyle) is a minimal, runtime string styling API and is re-exported as [`style`]
//! - [owo-colors](https://docs.rs/owo-colors) is a feature rich runtime string styling API
//! - [color-print](https://docs.rs/color-print) for feature-rich compile-time styling API
//! See also [`Formatter::default_level_style`]
//!
//! ```
//! use std::io::Write;
Expand Down Expand Up @@ -78,7 +84,7 @@ impl Default for TimestampPrecision {
/// A formatter to write logs into.
///
/// `Formatter` implements the standard [`Write`] trait for writing log records.
/// It also supports terminal colors, through the [`style`] method.
/// It also supports terminal styling using ANSI escape codes.
///
/// # Examples
///
Expand All @@ -95,7 +101,6 @@ impl Default for TimestampPrecision {
///
/// [`Write`]: std::io::Write
/// [`writeln`]: std::writeln
/// [`style`]: #method.style
pub struct Formatter {
buf: Rc<RefCell<Buffer>>,
write_style: WriteStyle,
Expand Down

0 comments on commit c67579c

Please sign in to comment.