format_label

Macro format_label 

Source
macro_rules! format_label {
    (label: $label:expr, $($arg:tt)+) => { ... };
    ($($arg:tt)+) => { ... };
}
Expand description

Formats your message with the specified output label

let _msg = format_label!(
    label: OutputLabel::Info("Building"),
    "one crate at a time"
);

§Example

It can be useful when you need to have a correctly formatted message but you don’t want to print it directly to the terminal.

use label_logger::{format_label, OutputLabel};
use indicatif::ProgressBar;

let mut bar = ProgressBar::new(100);
let msg = format_label!(
   label: OutputLabel::Info("Building"),
  "one crate at a time"
);

bar.set_message(msg);