use chrono::Local; use std::io::{self, BufRead, BufReader}; fn main() -> io::Result<()> { let stdin = io::stdin(); let reader = BufReader::new(stdin); for line in reader.lines() { let line = line?; let timestamp = Local::now().format("[%Y-%m-%d %H:%M:%S]"); println!("{} {}", timestamp, line); } Ok(()) }