Skip to content

Commit c0110ab

Browse files
committed
fix: don't log full document on write
1 parent 6dd18b8 commit c0110ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/log.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,17 @@ impl Logger {
5555

5656
impl Log for Logger {
5757
fn log(&mut self, op: Operation) -> std::io::Result<()> {
58-
let span = span!(Level::DEBUG, "log", op = ?op);
58+
let op_type = match &op {
59+
Operation::Insert { .. } => "insert",
60+
Operation::Update { .. } => "update",
61+
Operation::Delete { .. } => "delete",
62+
};
63+
let op_id = match &op {
64+
Operation::Insert { id, .. } => id,
65+
Operation::Update { id, .. } => id,
66+
Operation::Delete { id } => id,
67+
};
68+
let span = span!(Level::DEBUG, "log", op_type, op_id);
5969
let _enter = span.enter();
6070

6171
if self.file.metadata()?.len() > self.rotation_threshold {

0 commit comments

Comments
 (0)