1 //! Macros used on ouch.
3 /// Macro that prints \[INFO\] messages, wraps [`eprintln`].
5 /// There are essentially two different versions of the `info!()` macro:
6 /// - `info!(accessible, ...)` should only be used for short, important
7 /// information which is expected to be useful for e.g. blind users whose
8 /// text-to-speech systems read out every output line, which is why we
9 /// should reduce nonessential output to a minimum when running in
11 /// - `info!(inaccessible, ...)` can be used more carelessly / for less
12 /// important information. A seeing user can easily skim through more lines
13 /// of output, so e.g. reporting every single processed file can be helpful,
14 /// while it would generate long and hard to navigate text for blind people
15 /// who have to have each line of output read to them aloud, without to
16 /// ability to skip some lines deemed not important like a seeing person would.
19 // Accessible (short/important) info message.
20 // Show info message even in ACCESSIBLE mode
21 (accessible, $($arg:tt)*) => {{
22 use $crate::utils::colors::{YELLOW, RESET};
24 if $crate::accessible::is_running_in_accessible_mode() {
25 eprint!("{}Info:{} ", *YELLOW, *RESET);
27 eprint!("{}[INFO]{} ", *YELLOW, *RESET);
32 // Inccessible (long/no important) info message.
33 // Print info message if ACCESSIBLE is not turned on
34 (inaccessible, $($arg:tt)*) => {{
35 use $crate::utils::colors::{YELLOW, RESET};
37 if !$crate::accessible::is_running_in_accessible_mode() {
38 eprint!("{}[INFO]{} ", *YELLOW, *RESET);
44 /// Macro that prints WARNING messages, wraps [`eprintln`].
46 macro_rules! warning {
48 use $crate::utils::colors::{ORANGE, RESET};
50 if $crate::accessible::is_running_in_accessible_mode() {
51 eprint!("{}Warning:{} ", *ORANGE, *RESET);
53 eprint!("{}[WARNING]{} ", *ORANGE, *RESET);