Skip to content

Commit

Permalink
Do not use log types in public functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfxb committed Jul 22, 2024
1 parent 396c5d2 commit 5521816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ impl Binding for TraceLevel {

impl TraceLevel {
/// Attempt to convert this [TraceLevel] to a [log::LevelFilter].
///
/// This function is not public to avoid having a public dependency on [`log`].
///
/// This is done trivially with two exceptions:
/// - [TraceLevel::None] goes to [None]
/// - [TraceLevel::Fatal] goes to [log::Level::Error].
pub const fn as_log_level(self) -> Option<log::Level> {
const fn as_log_level(self) -> Option<log::Level> {
use log::Level;

match self {
Expand Down

0 comments on commit 5521816

Please sign in to comment.