Skip to content

Commit

Permalink
feat: log buffer contents
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Dec 2, 2023
1 parent c94cb42 commit 3d33512
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/transport-ipc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ impl futures::stream::Stream for ReadJsonStream {
this.items.push(response);
}
Some(Err(e)) => {
tracing::error!(%e, "IPC response contained invalid JSON");
tracing::error!(%e, "IPC response contained invalid JSON. Buffer contents will be logged at trace level");
tracing::trace!(
buffer = %String::from_utf8_lossy(this.buf.as_ref()),
"IPC response contained invalid JSON. NOTE: Buffer contents do not include invalid utf8.",
);

return Ready(None);
}
None => {}
Expand Down

0 comments on commit 3d33512

Please sign in to comment.