clerr
This library aids in command-line error reporting.
clerr = "0.10.0"
Examples
Simple Report
use *;
let code: Code = error;
let report: Report = from;
eprintln!;
error[E001]: file not found
Token Info
Highlight a specific token in a source line with a message, similar to rustc output.
use *;
let code: Code = warning;
let info: TokenInfo = TokenInfo ;
let report: Report = from.with_entry;
eprintln!;
warning[W012]: unused variable
--> src/main.rs [line=8, position=9]
|
8 | let x = 42;
| ^ --- consider prefixing with `_`
|
Properties
Display aligned key-value pairs under a report.
use *;
let props: Properties = default
.with_property
.with_property
.with_property;
let code: Code = error;
let report: Report = from.with_entry;
eprintln!;
error[E042]: invalid encoding
file: /etc/config.yml
expected: utf-8
found: binary
Severity Levels
Three severity levels are available, each with a distinct color:
| Level | Color |
|---|---|
Error |
Red |
Warning |
Yellow |
Info |
Blue |
These colors are intentionally fixed for consistency.
Issues & Contributing
See ISSUES.md for future work and CONTRIBUTING.md for guidelines.