Skip to content

Commit

Permalink
add some debug logs about server->client message size
Browse files Browse the repository at this point in the history
  • Loading branch information
blahgeek committed Jan 6, 2024
1 parent ca49a02 commit d3b9c98
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ fn process_server_reader(reader: impl std::io::Read,
}
if let Some(ref bytecode_options) = bytecode_options {
let json_val = json::from_str(&msg)?;
if let Ok(bytecode_str) = bytecode::generate_bytecode_repl(&json_val, bytecode_options.clone()) {
channel_pub.send(bytecode_str)?;
continue
match bytecode::generate_bytecode_repl(&json_val, bytecode_options.clone()) {
Ok(bytecode_str) => {
debug!("server->client: json {} bytes; converted to bytecode, {} bytes",
msg.len(), bytecode_str.len());
channel_pub.send(bytecode_str)?;
continue
},
Err(err) => {
warn!("Failed to convert json to bytecode: {}", err);
},
}
}
debug!("server->client: json {} bytes; forward as-is", msg.len());
channel_pub.send(msg)?;
}
Ok(())
Expand Down

0 comments on commit d3b9c98

Please sign in to comment.