-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
use crate::NO_COLOR_IS_SET; | ||
|
||
#[macro_export] | ||
macro_rules! info { | ||
|
||
($writer:expr, $($arg:tt)*) => { | ||
use crate::utils::colors::{reset, yellow}; | ||
print!("{}[INFO]{} ", yellow(), reset()); | ||
use crate::macros::_info_helper; | ||
_info_helper(); | ||
println!($writer, $($arg)*); | ||
}; | ||
($writer:expr) => { | ||
print!("{}[INFO]{} ", yellow(), reset()); | ||
_info_helper(); | ||
println!($writer); | ||
}; | ||
} | ||
|
||
pub fn _info_helper() { | ||
use crate::utils::colors::{reset, yellow}; | ||
|
||
if *NO_COLOR_IS_SET { | ||
print!("[INFO] "); | ||
} else { | ||
print!("{}[INFO]{} ", yellow(), reset()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b099e4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to https://no-color.org/ 🙂
PR link: jcs/no_color#135