7 releases (4 breaking)

0.5.0 Apr 1, 2022
0.4.1 Jul 29, 2021
0.4.0 May 9, 2021
0.3.0 Jan 6, 2021
0.1.0 Dec 31, 2020

#132 in Command-line interface

Download history 7653/week @ 2024-03-26 9476/week @ 2024-04-02 7432/week @ 2024-04-09 6623/week @ 2024-04-16 6925/week @ 2024-04-23 6896/week @ 2024-04-30 5933/week @ 2024-05-07 6874/week @ 2024-05-14 7292/week @ 2024-05-21 8766/week @ 2024-05-28 7691/week @ 2024-06-04 7482/week @ 2024-06-11 7557/week @ 2024-06-18 8549/week @ 2024-06-25 6982/week @ 2024-07-02 6394/week @ 2024-07-09

30,642 downloads per month
Used in 20 crates (7 directly)

MIT/Apache

27KB
628 lines

bugreport

Continuous integration Crates.io Documentation

bugreport is a Rust library that helps application developers to automatically collect information about the system and the environment that users can send along with a bug report (similar to git bugreport or ffmpeg … -report).

Note: This library is in an early stage and the API may change in the future.

Example

The following code

use bugreport::{bugreport, collector::*, format::Markdown};

fn main() {
    bugreport!()
        .info(SoftwareVersion::default())
        .info(OperatingSystem::default())
        .info(CommandLine::default())
        .info(EnvironmentVariables::list(&["SHELL", "EDITOR"]))
        .info(CommandOutput::new("Python version", "python", &["-V"]))
        .info(CompileTimeInformation::default())
        .print::<Markdown>();
}

generates bug report information that looks like this.

Collectors

  • Crate information (name, version, git hash)
  • Operating system (type, name, version)
  • Command line (including all arguments)
  • Environment variables (e.g. SHELL, PATH, …)
  • File contents (e.g. config files)
  • Directory contents
  • Command output (e.g. bash --version)
  • Compile time information (profile, target, architecture, cpu features, etc.)
  • Current working directory
  • Date and time
  • User defined collectors

Features

  • Markdown export
  • Open report output in editor (instead of printing to stdout, see git bugreport)
  • Ask user for permission to gather information?
  • Automatic anonymization of information? (e.g.: remove /home/username from paths)
  • JSON export (?)

Use cases / prior art

Related crates

Other crates that might be useful:

  • human-panic - Make panic messages nice for humans to read.

Dependencies

~155KB