#macro #codebase #badge

bugsalot

Debugging macros and APIs for shipping stable codebases

12 releases

0.2.2 Jan 26, 2022
0.2.1 Dec 23, 2019
0.1.8 Dec 1, 2019
0.1.4 Jun 30, 2019

#343 in Debugging

Download history 25/week @ 2024-06-14 19/week @ 2024-06-21 10/week @ 2024-06-28 11/week @ 2024-07-05 20/week @ 2024-07-12 13/week @ 2024-07-19 18/week @ 2024-07-26 28/week @ 2024-08-02 5/week @ 2024-08-09 9/week @ 2024-08-16 14/week @ 2024-08-23 14/week @ 2024-08-30 13/week @ 2024-09-06 5/week @ 2024-09-13 18/week @ 2024-09-20 32/week @ 2024-09-27

68 downloads per month
Used in 4 crates

MIT/Apache

41KB
391 lines

bugsalot

GitHub unsafe: yes rust: 1.36.0+ License dependency status

This crate provides macros and methods for bug wrangling. Specifically, I want all the advantages of crashing (bug reports, ease of debugging, etc.) with none of the drawbacks (lost progress, pissed off gamers, etc). Rust's error handling mechanisms (Try, ?, Results, etc.) are great, but leave something to be desired when it comes to actual bugs. Similarly, Rust's panic!, .unwrap(), .expect(), etc. are decent when it comes to giving context for bugs, but less great for writing stable software. This crate will attempt to bridge the gap.

Branch Badges Notes
publish Crates.io Docs Stable/published version
master Build Status Open issues "Completed" stuff that hasn't been published.
wip/* "Work In Progress" - incomplete, use at your own risk.
dead/* Abandoned threads of work

Platforms

Platform Breakpoints Debugger CI Stable Beta Nightly
Windows Supported Supported Tests Status
Android Supported Supported Build Status
Linux Supported Supported Tests Status Status Status
(Release) Status
FreeBSD Untested Untested No
NetBSD Untested Untested No
OS X Untested Untested Tests Status
iOS Untested Untested Build Status
WASM Supported N/A Build Status

Quick Start

Add one of the following bugsalot dependencies to your Cargo.toml:

[dependencies]
bugsalot = "0.2"                                            # Or...
bugsalot = { version = "0.2", features = ["wasm-bindgen"] } # If using: wasm-pack
bugsalot = { version = "0.2", features = ["stdweb"]       } # If using: cargo web build

Write your code (see examples and documentation for more code):

use bugsalot::*;

fn main() {
    let _ = debugger::wait_until_attached(None); // Wait for a debugger to be attached

    loop {
        let a : Option<i32> = Some(42);
        let b : Result<i32, &'static str> = Err("Unavailable");
        let a = expect!(a, "Unable to do something or other", return);
        let b = expect!(b, "Unable to do something or other", break);
        // Debugger will pause on the above line, continuing will break out of the loop
    }

    expect!(true, "Booleans work too");
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0–650KB
~12K SLoC