Skip to content

Commit c67579c

Browse files
committed
docs(fmt): Talk about new styling API
The documentation for the old API was overlooked in #298
1 parent 62713d1 commit c67579c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/fmt/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
//!
1010
//! The format used to print log records can be customised using the [`Builder::format`]
1111
//! method.
12-
//! Custom formats can apply different color and weight to printed values using
13-
//! [`Style`] builders.
12+
//!
13+
//! Terminal styling is done through ANSI escape codes and will be adapted to the capabilities of
14+
//! the target stream.
15+
//! For example, you could use one of:
16+
//! - [anstyle](https://docs.rs/anstyle) is a minimal, runtime string styling API and is re-exported as [`style`]
17+
//! - [owo-colors](https://docs.rs/owo-colors) is a feature rich runtime string styling API
18+
//! - [color-print](https://docs.rs/color-print) for feature-rich compile-time styling API
19+
//! See also [`Formatter::default_level_style`]
1420
//!
1521
//! ```
1622
//! use std::io::Write;
@@ -78,7 +84,7 @@ impl Default for TimestampPrecision {
7884
/// A formatter to write logs into.
7985
///
8086
/// `Formatter` implements the standard [`Write`] trait for writing log records.
81-
/// It also supports terminal colors, through the [`style`] method.
87+
/// It also supports terminal styling using ANSI escape codes.
8288
///
8389
/// # Examples
8490
///
@@ -95,7 +101,6 @@ impl Default for TimestampPrecision {
95101
///
96102
/// [`Write`]: std::io::Write
97103
/// [`writeln`]: std::writeln
98-
/// [`style`]: #method.style
99104
pub struct Formatter {
100105
buf: Rc<RefCell<Buffer>>,
101106
write_style: WriteStyle,

0 commit comments

Comments
 (0)