Macro farve::farve

source ·
macro_rules! farve {
    ($func:ident, $prefix:expr, $bracket_brightness:expr) => { ... };
    ($func:ident, $prefix:expr) => { ... };
    ($func:ident) => { ... };
}
Expand description

Create a new println function with a prefix and brackets (0-2 brightness).

$func - the name of the function, it should not be wrapped in quotes. $prefix - the prefix, it should be wrapped in quotes (default: function name). $bracket_brightness - 0 | 1 | 2; brightness of the brackets (default: 0).

Examples

use owo_colors::OwoColorize;
use farve::farve;

farve!(silly, "silly 😋".white().bold(), 2);
farve!(info);
farve!(warn, "warn".yellow().underline());


silly("Hello, world!");
info("The weather is nice today.");
warn("I almost couldn't, but I did it!");

Output (imagine color)

[silly 😋] Hello, world!
[info] The weather is nice today.
[warn] I almost couldn't, but I did it!