Skip to content

Commit 3a697a7

Browse files
committed
log: Providing more information on parsing dates
1 parent 6d1563b commit 3a697a7

File tree

1 file changed

+3
-1
lines changed
  • crates/compass/src/scraper/log

1 file changed

+3
-1
lines changed

crates/compass/src/scraper/log/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::sync::LazyLock;
1616

1717
use chrono::NaiveDateTime;
1818
use regex::Regex;
19-
use tracing::{debug, trace};
19+
use tracing::{debug, error, trace};
2020

2121
use crate::error::Result;
2222
use loglevel::LogLevel;
@@ -49,8 +49,10 @@ impl LogRecord {
4949
})?;
5050

5151
let timestamp_str = caps.get(1).unwrap().as_str().to_string();
52+
trace!("Parsing timestamp: {}", timestamp_str);
5253
let timestamp = NaiveDateTime::parse_from_str(&timestamp_str, "%Y-%m-%d %H:%M:%S,%3f")
5354
.map_err(|e| {
55+
error!("Failed to parse timestamp: {}, error: {}", timestamp_str, e);
5456
crate::error::Error::Undefined(format!(
5557
"Failed to parse timestamp '{}': {}",
5658
timestamp_str, e

0 commit comments

Comments
 (0)