deps(common_utils): put the signals module behind a feature flag (#814)

This commit is contained in:
ItsMeShashank
2023-04-04 11:29:05 +05:30
committed by GitHub
parent 6f61f83066
commit fb4ec43157
6 changed files with 22 additions and 35 deletions

View File

@ -3,6 +3,7 @@
use error_stack::report;
use once_cell::sync::Lazy;
use regex::Regex;
#[cfg(feature = "logs")]
use router_env::logger;
use crate::errors::{CustomResult, ValidationError};
@ -15,8 +16,9 @@ pub fn validate_email(email: &str) -> CustomResult<(), ValidationError> {
r"^(?i)[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$",
) {
Ok(regex) => Some(regex),
Err(error) => {
logger::error!(?error);
Err(_error) => {
#[cfg(feature = "logs")]
logger::error!(?_error);
None
}
}