leg

This library prints to stderr to be nice with your pipes. Moreover, thanks to the awesome colored crate:

  • Works on Linux, MacOS, and Windows (Powershell).
  • Respects CLICOLOR/CLICOLOR_FORCE and NO_COLOR behavior.

Use

? Please visit the full documentation if you want to learn the details.

use leg::*;

head("leg", Some("?"), Some("1.0.0"));

info("Informational message", None, None);
success("Successful operation", None, None);
warn("Warn message", None, None);
error("Error message", None, None);
wait("Waiting for something", None, None);
done("Something finished", None, None);

print!("Not shown");
remove();

info("Informational message with scope", Some("myscope"), None);
info(
    "Informational message without new line",
    None,
    Some(false),
);
println!(" => same line");

GitHub