feat: debug protocol messages

This commit is contained in:
Greg Heartsfield 2021-12-23 21:30:04 -06:00
parent 8a8ee5c425
commit bfc804e18c

View File

@ -53,6 +53,7 @@ impl Stream for NostrStream {
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
/// Convert Message to NostrMessage /// Convert Message to NostrMessage
fn convert(msg: String) -> Result<NostrMessage> { fn convert(msg: String) -> Result<NostrMessage> {
debug!("raw msg: {}", msg);
let parsed_res: Result<NostrMessage> = serde_json::from_str(&msg).map_err(|e| e.into()); let parsed_res: Result<NostrMessage> = serde_json::from_str(&msg).map_err(|e| e.into());
match parsed_res { match parsed_res {
Ok(m) => Ok(m), Ok(m) => Ok(m),