diff --git a/src/detections/detection.rs b/src/detections/detection.rs index dfcf0ddf..70225051 100644 --- a/src/detections/detection.rs +++ b/src/detections/detection.rs @@ -83,11 +83,25 @@ impl Detection { err_msgs_result.err().iter().for_each(|err_msgs| { let errmsg_body = format!("Failed to parse rule file. (FilePath : {})", rule.rulepath); - AlertMessage::warn(&mut std::io::stdout().lock(), &errmsg_body).ok(); + if configs::CONFIG.read().unwrap().args.is_present("verbose") { + AlertMessage::warn(&mut std::io::stdout().lock(), &errmsg_body).ok(); - err_msgs.iter().for_each(|err_msg| { - AlertMessage::warn(&mut std::io::stdout().lock(), err_msg).ok(); - }); + err_msgs.iter().for_each(|err_msg| { + AlertMessage::warn(&mut std::io::stdout().lock(), err_msg).ok(); + }); + } + if !*QUIET_ERRORS_FLAG { + ERROR_LOG_STACK + .lock() + .unwrap() + .push(format!("[WARN] {}", errmsg_body)); + err_msgs.iter().for_each(|err_msg| { + ERROR_LOG_STACK + .lock() + .unwrap() + .push(format!("[WARN] {}", err_msg)); + }); + } parseerror_count += 1; println!(""); // 一行開けるためのprintln });