Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing text prefix that makes the log an invalid json #72

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/electrum/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ impl Connection {
"port": self.addr.port(),
}),
);
println!("ELECTRUM-RPC-LOGGER: {}", log);
println!("{}", log);
}

fn send_values(&mut self, values: &[Value]) -> Result<()> {
Expand All @@ -527,6 +527,7 @@ impl Connection {
let empty_params = json!([]);
loop {
let msg = self.chan.receiver().recv().chain_err(|| "channel closed")?;
let start_time = Instant::now();
trace!("RPC {:?}", msg);
match msg {
Message::Request(line) => {
Expand Down Expand Up @@ -555,7 +556,6 @@ impl Connection {
})
);

let start_time = Instant::now();
let reply = self.handle_command(method, params, id)?;

conditionally_log_rpc_event!(
Expand All @@ -564,7 +564,7 @@ impl Connection {
"event": "rpc response",
"method": method,
"payload_size": reply.to_string().as_bytes().len(),
"duration_µs": start_time.elapsed().as_micros(),
"duration_micros": start_time.elapsed().as_micros(),
"id": id,
})
);
Expand Down
Loading