Skip to content

Commit d3b9c98

Browse files
committed
add some debug logs about server->client message size
1 parent ca49a02 commit d3b9c98

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/app.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,19 @@ fn process_server_reader(reader: impl std::io::Read,
7373
}
7474
if let Some(ref bytecode_options) = bytecode_options {
7575
let json_val = json::from_str(&msg)?;
76-
if let Ok(bytecode_str) = bytecode::generate_bytecode_repl(&json_val, bytecode_options.clone()) {
77-
channel_pub.send(bytecode_str)?;
78-
continue
76+
match bytecode::generate_bytecode_repl(&json_val, bytecode_options.clone()) {
77+
Ok(bytecode_str) => {
78+
debug!("server->client: json {} bytes; converted to bytecode, {} bytes",
79+
msg.len(), bytecode_str.len());
80+
channel_pub.send(bytecode_str)?;
81+
continue
82+
},
83+
Err(err) => {
84+
warn!("Failed to convert json to bytecode: {}", err);
85+
},
7986
}
8087
}
88+
debug!("server->client: json {} bytes; forward as-is", msg.len());
8189
channel_pub.send(msg)?;
8290
}
8391
Ok(())

0 commit comments

Comments
 (0)