mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-30 00:50:05 +08:00
add debug
This commit is contained in:
@@ -2,7 +2,7 @@ use std::{
|
||||
io::{self, Write},
|
||||
};
|
||||
|
||||
pub enum MessageType { INFO, OK, WARN, ERROR, }
|
||||
pub enum MessageType { INFO, OK, WARN, ERROR, DEBUG, }
|
||||
|
||||
pub fn print_color(color: Option<term::color::Color>, is_bold: bool, m: &str) {
|
||||
let mut t = term::stdout().unwrap();
|
||||
@@ -33,6 +33,7 @@ pub fn print_message(mt: MessageType, message: &str) {
|
||||
MessageType::WARN => print_message_ex(Some(term::color::YELLOW), "[WARN ]", message),
|
||||
MessageType::ERROR => print_message_ex(Some(term::color::RED), "[ERROR]", message),
|
||||
MessageType::INFO => print_message_ex(None, "[INFO ]", message),
|
||||
MessageType::DEBUG => print_message_ex(Some(term::color::MAGENTA), "[DEBUG]", message),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user