#diagnostics #cross-platform #cli #terminal #bugreport

bugreport

Collect system and environment information for bug reports

5 releases (3 breaking)

0.4.0 May 9, 2021
0.3.0 Jan 6, 2021
0.2.1 Jan 1, 2021
0.2.0 Jan 1, 2021
0.1.0 Dec 31, 2020

#109 in Command-line interface

Download history 655/week @ 2021-02-21 3613/week @ 2021-02-28 2546/week @ 2021-03-07 2138/week @ 2021-03-14 2107/week @ 2021-03-21 1854/week @ 2021-03-28 1946/week @ 2021-04-04 1922/week @ 2021-04-11 1621/week @ 2021-04-18 1837/week @ 2021-04-25 1709/week @ 2021-05-02 3475/week @ 2021-05-09 3279/week @ 2021-05-16 3169/week @ 2021-05-23 3191/week @ 2021-05-30 3238/week @ 2021-06-06

8,900 downloads per month
Used in 9 crates (3 directly)

MIT/Apache

23KB
567 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)
  • 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

Dependencies

~155KB