pub struct LoggingUtils {}

impl LoggingUtils {
    pub fn secret(value: Option<&str>) -> String {
        match value {
            Some(v) => {
                if v.len() < 8 {
                    "********".to_string()
                } else {
                    let start = &v[..4];
                    let end = &v[v.len() - 4..];
                    format!("{}*****{}", start, end)
                }
            }
            None => "None".to_string(),
        }
    }
}
