Skip to content

Commit

Permalink
Fix new (docu-related) clippies
Browse files Browse the repository at this point in the history
  • Loading branch information
emabee committed Sep 23, 2024
1 parent abd66da commit ff0da56
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
45 changes: 22 additions & 23 deletions src/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ where
}

/// A logline-formatter that produces log lines like <br>
/// ```INFO [my_prog::some_submodule] Task successfully read from conf.json```,
/// or
/// ```INFO [my_prog::some_submodule] Task successfully read from conf.json```.
///
/// If the kv-feature is used, the log lines look like
/// ```INFO [my_prog::some_submodule] {a=17, b="foo"} Task successfully read from conf.json```
/// if the kv-feature is used.
///
/// # Errors
///
Expand All @@ -77,12 +77,13 @@ pub fn default_format(
write!(w, "{}", record.args())
}

/// A colored version of the logline-formatter `default_format`
/// that produces log lines like <br>
/// A colored version of the logline-formatter `default_format`.
///
/// It produces log lines like <br>
/// <code><span style="color:red">ERROR</span> &#91;`my_prog::some_submodule`&#93; <span
/// style="color:red">File not found</span></code>
///
/// See method `[style](crate::style)` if you want to influence coloring.
/// See method [`style`](crate::style) if you want to influence coloring.
///
/// # Errors
///
Expand Down Expand Up @@ -138,7 +139,7 @@ pub fn opt_format(

/// A colored version of the logline-formatter `opt_format`.
///
/// See method [style](crate::style) if you want to influence coloring.
/// See method [`style`](crate::style) if you want to influence coloring.
///
/// # Errors
///
Expand Down Expand Up @@ -166,11 +167,10 @@ pub fn colored_opt_format(
write!(w, "{}", style(level).paint(record.args().to_string()))
}

/// A logline-formatter that produces log lines like
/// <br>
/// A logline-formatter that produces log lines like <br>
/// ```[2016-01-13 15:25:01.640870 +01:00] INFO [foo::bar] src/foo/bar.rs:26: Task successfully read from conf.json```
/// <br>
/// i.e. with timestamp, module path and file location.
///
/// I.e. with timestamp, module path and file location.
///
/// # Errors
///
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn detailed_format(

/// A colored version of the logline-formatter `detailed_format`.
///
/// See method [style](crate::style) if you want to influence coloring.
/// See method [`style`](crate::style) if you want to influence coloring.
///
/// # Errors
///
Expand Down Expand Up @@ -227,11 +227,10 @@ pub fn colored_detailed_format(
write!(w, "{}", style(level).paint(record.args().to_string()))
}

/// A logline-formatter that produces log lines like
/// <br>
/// A logline-formatter that produces log lines like <br>
/// ```[2016-01-13 15:25:01.640870 +01:00] T[taskreader] INFO [src/foo/bar:26] Task successfully read from conf.json```
/// <br>
/// i.e. with timestamp, thread name and file location.
///
/// I.e. with timestamp, thread name and file location.
///
/// # Errors
///
Expand Down Expand Up @@ -259,7 +258,7 @@ pub fn with_thread(

/// A colored version of the logline-formatter `with_thread`.
///
/// See method [style](crate::style) if you want to influence coloring.
/// See method [`style`](crate::style) if you want to influence coloring.
///
/// # Errors
///
Expand Down Expand Up @@ -448,13 +447,13 @@ fn parse_style(input: &str) -> Result<Style, std::num::ParseIntError> {
})
}

/// Can be used in
/// [`Logger::adaptive_format_for_stderr`](crate::Logger::adaptive_format_for_stderr) and
/// [`Logger::adaptive_format_for_stdout`](crate::Logger::adaptive_format_for_stdout)
/// to use coloring only if the output goes to a tty.
/// Helps to use coloring only if the output goes to a tty.
///
/// This is helpful if the output is sometimes piped into other programs, which usually
/// do not expect color control byte sequences.
/// Is used in
/// [`Logger::adaptive_format_for_stderr`](crate::Logger::adaptive_format_for_stderr) and
/// [`Logger::adaptive_format_for_stdout`](crate::Logger::adaptive_format_for_stdout),
/// which switch off coloring if the output is not going to a tty but is piped into another
/// program, because then color control byte sequences are usually not expected.
#[derive(Clone, Copy)]
pub enum AdaptiveFormat {
/// Chooses between [`default_format`](crate::default_format)
Expand Down
5 changes: 3 additions & 2 deletions src/writers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Describes how to extend `flexi_logger` with additional log writers
//! (implementations of the trait [`LogWriter`]), and contains two ready-to-use log writers,
//! Describes how to extend `flexi_logger` with additional log writers.
//!
//! The module also contains two ready-to-use log writers,
//! one for writing to files ([`FileLogWriter`]), one for writing to the syslog ([`SyslogWriter`]).
//!
//! Log writers can be used in two ways:
Expand Down

0 comments on commit ff0da56

Please sign in to comment.