blargle

Crates.ioblargle
lib.rsblargle
version0.1.0
created_at2025-08-05 02:57:15.160668+00
updated_at2025-08-05 02:57:15.160668+00
descriptionProvides debugging macros which resolves to compiler errors for release builds
homepage
repositoryhttps://gitlab.com/nickeldan/blargle
max_upload_size
id1781461
size9,750
Daniel Walker (nickeldan)

documentation

README

The crate you never use.

Blargle provides several macros that allow for the printing of debug statements. However, this is only case when compiling for debug mode. When compiling for release mode, all of the macros generate compiler errors. The idea is that you would use these macros when trying to diagnose some problem in your code but, when it was time to build for production, the compiler errors would remind you that you had accidentally left them in.

E.g.,

blargle::println!("I've reached this point in the code");

For debug builds, this would resolve to

println!("I've reached this point in the code");

Similarly, there are macros for print, eprintln, eprint, and dbg.

log feature

If you enable the log feature, you will have access to wrappers around the log crates macros. E.g.,

blargle::log_info!("Don't forget to delete this line");

Placeholder

There is one last macro, blargle::placeholder!(). For debug builds, it resolves to a no op. However, it generates a compiler error for release builds. As the name suggests, this macro represents functionalitiy which you've yet to implement. E.g.,

fn validate_login(_name: &str, _password: &str) -> bool {
    blargle::placeholder!();
    true
}
Commit count: 0

cargo fmt