Skip to content

Commit

Permalink
syslinereader.rs debug print DTPI attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Jan 13, 2023
1 parent d9f70ce commit 35fbb1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/readers/syslinereader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ impl SyslineReader {
}

const HACK12: &[u8; 2] = b"12";
let mut _attempts: usize = 0;
// `sie` and `siea` is one past last char; exclusive.
// `actual` are more confined slice offsets of the datetime,
// XXX: it might be faster to skip the special formatting and look directly for the datetime stamp.
Expand Down Expand Up @@ -1020,6 +1021,7 @@ impl SyslineReader {
// TODO: add stat for tracking this branch of hack pattern matching
continue;
}
_attempts += 1;
// find the datetime string using `Regex`, convert to a `DateTimeL`
let dt: DateTimeL;
let dt_beg: LineIndex;
Expand All @@ -1034,7 +1036,7 @@ impl SyslineReader {
return ResultFindDateTime::Ok((dt_beg, dt_end, dt, *index));
} // end for(pattern, ...)

dpfx!("return Err(ErrorKind::NotFound);");
dpfx!("return Err(ErrorKind::NotFound); tried {} DateTimeParseInstr", _attempts);
ResultFindDateTime::Err(Error::new(ErrorKind::NotFound, "No datetime found in Line!"))
}

Expand Down

0 comments on commit 35fbb1d

Please sign in to comment.