Skip to content

Commit b86aabc

Browse files
little-dudehawkw
authored and
Corentin Henry
committed
clean up journald documentation
Co-authored-by: Eliza Weisman <[email protected]>
1 parent 0d2b814 commit b86aabc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tracing-journald/src/lib.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl Subscriber {
133133
self
134134
}
135135

136-
/// Sets the mappings from the tracing level to the journald priorities.
136+
/// Sets how [`tracing::Level`]s are mapped to [journald priorities](Priority).
137137
pub fn with_priority_mappings(mut self, mappings: PriorityMappings) -> Self {
138138
self.priority_mappings = mappings;
139139
self
@@ -363,7 +363,7 @@ impl Visit for EventVisitor<'_> {
363363
}
364364
}
365365

366-
/// A priority (in syslog called severity code) is used to mark the
366+
/// A priority (called "severity code" by syslog) is used to mark the
367367
/// importance of a message.
368368
///
369369
/// Descriptions and examples are taken from the [Arch Linux wiki].
@@ -431,7 +431,9 @@ pub enum Priority {
431431
Debug = b'7',
432432
}
433433

434-
/// Mappings from the tracing levels to the journald priorities.
434+
/// Mappings from tracing [`Level`]s to journald [priorities].
435+
///
436+
/// [priorities]: Priority
435437
#[derive(Debug, Clone)]
436438
pub struct PriorityMappings {
437439
/// Priority mapped to the `ERROR` level
@@ -447,13 +449,13 @@ pub struct PriorityMappings {
447449
}
448450

449451
impl PriorityMappings {
450-
/// Create new default mappings:
452+
/// Returns the default priority mappings:
451453
///
452-
/// - `tracing::Level::ERROR`: Error (3)
453-
/// - `tracing::Level::WARN`: Warning (4)
454-
/// - `tracing::Level::INFO`: Notice (5)
455-
/// - `tracing::Level::DEBUG`: Informational (6)
456-
/// - `tracing::Level::TRACE`: Debug (7)
454+
/// - [`tracing::Level::ERROR`]: [`Priority::Error`] (3)
455+
/// - [`tracing::Level::WARN`]: [`Priority::Warning`] (4)
456+
/// - [`tracing::Level::INFO`]: [`Priority::Notice`] (5)
457+
/// - [`tracing::Level::DEBUG`]: [`Priority::Informational`] (6)
458+
/// - [`tracing::Level::TRACE`]: [`Priority::Debug`] (7)
457459
pub fn new() -> PriorityMappings {
458460
Self {
459461
error: Priority::Error,

0 commit comments

Comments
 (0)