nobb 0.1.0

Silence all console output by redirecting stdout and stderr to null device.
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • luzhihaoTestingLab

nobb

Silence all console output by redirecting stdout and stderr to the null device.

Usage

Add to your Cargo.toml:

[dependencies]
nobb = "0.1"

Example:

fn main() {
    println!("This will be shown");
    nobb::silence();
    println!("This will NOT be shown");
    eprintln!("Errors also silenced");
}

Notes

  • Works by calling libc::freopen to redirect OS-level streams to the null device.
  • On Unix, uses /dev/null; on Windows, uses NUL.
  • This affects the entire process; subsequent println!/eprintln! from any crate will be silenced.

License

MIT © 2025