switch level and timestamp
This commit is contained in:
parent
a1ff73b895
commit
0224e9d5b7
1 changed files with 2 additions and 3 deletions
|
@ -9,14 +9,13 @@ struct Cli {
|
|||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let cli = Cli::parse();
|
||||
let re = regex::Regex::new(r"^(.*)\s+(.*)$")?;
|
||||
let re = regex::Regex::new(r"^(.*?)[\t\s]+(.*?)[\t\s]+(.*)$")?;
|
||||
for line in read_to_string(cli.input)?.lines() {
|
||||
if let Some(caps) = re.captures(line) {
|
||||
println!("{:5} {}", &caps[1], &caps[2]);
|
||||
println!("{} {:5} {}", &caps[2], &caps[1], &caps[3]);
|
||||
} else {
|
||||
println!("{}", line);
|
||||
}
|
||||
println!("{}", line);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue