Skip to main content

Crate use_diagnostic_level

Crate use_diagnostic_level 

Source
Expand description

§use-diagnostic-level

Diagnostic severity primitives for RustUse.

§Foundation

use-diagnostic-level provides DiagnosticLevel, a small ordered severity enum with Info, Warning, Error, and Fatal.

More severe levels compare greater than less severe levels. The crate does not attach colors, terminal behavior, logging behavior, or exit-code behavior.

§Example

use use_diagnostic_level::DiagnosticLevel;

let level: DiagnosticLevel = "warn".parse().unwrap();

assert_eq!(level, DiagnosticLevel::Warning);
assert!(DiagnosticLevel::Fatal > DiagnosticLevel::Error);

§Scope

  • Levels are severity values only.
  • Parsing accepts common lowercase aliases.
  • Rendering, logging, process exits, and terminal color are out of scope.

§Status

use-diagnostic-level is a pre-1.0 crate with a deliberately small API.

Structs§

DiagnosticLevelParseError
Error returned when parsing a diagnostic level fails.

Enums§

DiagnosticLevel
The severity level of a diagnostic.