-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathprint.rs
46 lines (44 loc) · 1.27 KB
/
print.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// Prints to the standard error, with a newline.
///
/// Equivalent to the [`eprintln!`] macro except that an info prefix is
/// printed before the message.
#[macro_export]
macro_rules! infoln {
($($t:tt)*) => {{
eprint!("{} ", $crate::Style::InfoPrefix.paint("==>"));
eprintln!($($t)*);
}};
}
/// Prints to the standard error, with a newline.
///
/// Equivalent to the [`eprintln!`] macro except that an info prefix is
/// printed before the message.
#[macro_export]
macro_rules! debugln {
($($t:tt)*) => {{
eprint!("{} ", $crate::Style::DebugPrefix.paint("debug:"));
eprintln!($($t)*);
}};
}
/// Prints to the standard error, with a newline.
///
/// Equivalent to the [`eprintln!`] macro except that a warning prefix is
/// printed before the message.
#[macro_export]
macro_rules! warnln {
($($t:tt)*) => {{
eprint!("{} ", $crate::Style::WarningPrefix.paint("warning:"));
eprintln!($($t)*);
}};
}
/// Prints to the standard error, with a newline.
///
/// Equivalent to the [`eprintln!`] macro except that an error prefix is
/// printed before the message.
#[macro_export]
macro_rules! errln {
($($t:tt)*) => {{
eprint!("{} ", $crate::Style::ErrorPrefix.paint("error:"));
eprintln!($($t)*);
}};
}