-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
darkstar edited this page Oct 3, 2026
·
2 revisions
use diagprint::{Reporter, Severity};
fn main() -> std::io::Result<()> {
let reporter = Reporter::builder()
.application("myapp")
.min_severity(Severity::Info)
.build()?;
let diagnostic = reporter
.error("Network initialization failed")
.code("NET-001")
.cause("failed to open network interface")
.note("fallback networking is unavailable")
.help("check interface permissions and driver state");
reporter.emit(&diagnostic)?;
Ok(())
}let diagnostic = reporter
.error("Invalid configuration value")
.code("CFG-001")
.label("config.toml", 12, Some(9), Some(5), Some("unsupported value"))
.secondary_label("defaults.toml", 4, Some(1), Some(7), Some("default declared here"));label(file, line, column, length, message). Primary and secondary labels stay structurally distinct all the way through rendering and interop.
reporter.emit_github_actions(&diagnostic)?; // CI annotations
diagprint::render::SarifRenderer.write_many("target/diagprint.sarif", [&diagnostic])?; // code scanningdiagprint scan . # standard profile
diagprint scan . --static # executes nothing
diagprint scan . --deep --history .diagprint/historyTip
Add .diagprint/ to .gitignore so recorded history doesn't dirty later provenance-enabled scans.
Next: Diagnostics & Sources for snapshots and revisions, or Diagnostic Forensics to make use of that history.
🩺 diagprint · a Cybercore Tech project · MIT OR Apache-2.0
🏠 cybercoretech.net ·
✉️ dev@cybercoretech.net ·
🔒 security@ ·
💬 Discord ·
🐛 Issues ·
☕ Buy Me a Coffee
⚡ Start
- 📥 Installation
- 🚀 Quick Start
- 🧪 Examples
🧱 Build
📤 Ship
🔧 Fix
- 🔧 Remediation
- 🛡️ Safety Model
🔬 Investigate
🛠️ Project
- 🛠️ Contributing
- 🗺️ Roadmap